Skip to content

Commit 079cfe8

Browse files
committed
hcaptcha, upgrade
1 parent e480940 commit 079cfe8

File tree

4 files changed

+29
-23
lines changed

4 files changed

+29
-23
lines changed

.github/ISSUE_TEMPLATE/issue-report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If applicable, add screenshots to help explain your problem.
2929
**Desktop (please complete the following information):**
3030
- OS: [e.g. MacOS]
3131
- Install method and python version: [eg. docker, python 3.9]
32-
- Kobodl Version [e.g. 0.5.1]
32+
- Kobodl Version [e.g. 0.6.0]
3333

3434
**Additional context**
3535
Add any other context about the problem here.

kobodl/commands/user.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,25 @@ def add(ctx, email, password):
5050
user = User(Email=email)
5151
click.echo(
5252
"""
53-
Open https://authorize.kobo.com/signin in a private/incognito window in your browser, wait till the page
54-
loads (do not login!) then open the developer tools (use F12 in Firefox/Chrome), select the console tab,
55-
and paste the following code there and then press Enter there in the browser.
53+
1. Open https://authorize.kobo.com/signin in a private/incognito window in your browser.
54+
2. wait till the page loads (do not login!)
55+
3. open the developer tools (use F12 in Firefox/Chrome, or right-click and choose "inspect")
56+
4. select the console tab,
57+
5. copy-paste the following code to the console there and then press Enter.
5658
57-
var newCaptchaDiv = document.createElement( "div" );
58-
newCaptchaDiv.id = "new-grecaptcha-container";
59-
document.getElementById( "grecaptcha-container" ).insertAdjacentElement( "afterend", newCaptchaDiv );
60-
grecaptcha.render( newCaptchaDiv.id, {
61-
sitekey: "6Le_Hc8ZAAAAAO6IMIG5zdDmANbljtXY4EHK0wzD",
62-
callback: function( response ) { console.log( "Captcha response:" ); console.log( response ); }
63-
} );
59+
var newCaptchaDiv = document.createElement("div");
60+
newCaptchaDiv.id = "new-hcaptcha-container";
61+
var siteKey = document.getElementById('hcaptcha-container').getAttribute('data-sitekey');
62+
document.body.replaceChildren(newCaptchaDiv);
63+
grecaptcha.render(newCaptchaDiv.id, {
64+
sitekey: siteKey,
65+
callback: function(r) {console.log("Captcha response:");console.log(r);}
66+
});
67+
console.log('Click the checkbox to get the code');
6468
6569
A captcha should show up below the Sign-in form. Once you solve the captcha its response will be written
6670
below the pasted code in the browser's console. Copy the response (the line below "Captcha response:")
67-
and paste it here.
71+
and paste it here. It will be very long!
6872
"""
6973
)
7074
captcha = input('Captcha response: ').strip()

kobodl/templates/instructions.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ <h1 class="text-2xl py-2">CAPTCHA Code Instructions</h1>
1818
<div class="flex flex-wrap items-start">
1919
<img class="mr-4" width="580px" src="https://raw.githubusercontent.com/subdavis/kobo-book-downloader/master/docs/captcha.gif">
2020
<div class="flex-shrink rounded px-4 overflow-x-auto text-xs whitespace-pre font-mono" style="background-color: #f5f2f0; min-width: 420px;">
21-
var newCaptchaDiv = document.createElement( "div" );
22-
newCaptchaDiv.id = "new-grecaptcha-container";
23-
document.getElementById( "grecaptcha-container" )
24-
.insertAdjacentElement( "afterend", newCaptchaDiv );
21+
var newCaptchaDiv = document.createElement("div");
22+
newCaptchaDiv.id = "new-hcaptcha-container";
23+
var siteKey = document.getElementById('hcaptcha-container')
24+
.getAttribute('data-sitekey');
25+
document.body.replaceChildren(newCaptchaDiv);
2526
grecaptcha.render( newCaptchaDiv.id, {
26-
sitekey: "6Le_Hc8ZAAAAAO6IMIG5zdDmANbljtXY4EHK0wzD",
27-
callback: function( response ) {
28-
console.log( "Captcha response:" );
29-
console.log( response );
30-
}
31-
});</code></pre>
27+
sitekey: siteKey,
28+
callback: function(r) {
29+
console.log("Captcha response:");
30+
console.log(r);
31+
}
32+
});
33+
console.log('Click the checkbox to get the code');</code></pre>
3234
</div>
3335
</div>
3436
</div>

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
setup(
1010
name='kobodl',
1111
author='Brandon Davis',
12-
version='0.5.1',
12+
version='0.6.0',
1313
author_email='[email protected]',
1414
url="https://github.com/subdavis/kobo-book-downloader",
1515
long_description=long_description,

0 commit comments

Comments
 (0)