Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key error on kissmanga #868

Closed
Metichi opened this issue Jul 7, 2020 · 4 comments
Closed

Key error on kissmanga #868

Metichi opened this issue Jul 7, 2020 · 4 comments

Comments

@Metichi
Copy link

Metichi commented Jul 7, 2020

not sure if this is the correct way to describe the error, but as usual, the program told me to report with verbose so here I am.
I got similar errors running the -j option too, trying to download, and on different series. I can go in with the browser into the episodes just fine with no cloudflare/kissmanga captchas

gallery-dl -g https://kissmanga.com/Manga/Beastars --verbose
[gallery-dl][debug] Version 1.14.3-dev
[gallery-dl][debug] Python 3.8.2 - Linux-5.4.0-40-generic-x86_64-with-glibc2.29
[gallery-dl][debug] requests 2.22.0 - urllib3 1.25.8
[gallery-dl][debug] Starting UrlJob for 'https://kissmanga.com/Manga/Beastars'
[kissmanga][debug] Using KissmangaMangaExtractor for 'https://kissmanga.com/Manga/Beastars'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): kissmanga.com:443
[urllib3.connectionpool][debug] https://kissmanga.com:443 "GET /Manga/Beastars HTTP/1.1" 503 None
[kissmanga][info] Solving Cloudflare challenge
[urllib3.connectionpool][debug] Resetting dropped connection: kissmanga.com
[urllib3.connectionpool][debug] https://kissmanga.com:443 "GET /cdn-cgi/images/trace/jschal/nojs/transparent.gif?ray=5af0bcefcefbc677 HTTP/1.1" 200 42
[urllib3.connectionpool][debug] https://kissmanga.com:443 "GET /cdn-cgi/images/trace/jschal/js/nocookie/transparent.gif?ray=5af0bcefcefbc677 HTTP/1.1" 200 42
[kissmanga][error] An unexpected error occurred: KeyError - ' 100%; height: 100%; margin: 0; padding: 0;'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[kissmanga][debug]
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/gallery_dl-1.14.3.dev0-py3.8.egg/gallery_dl/job.py", line 61, in run
for msg in self.extractor:
File "/usr/local/lib/python3.8/dist-packages/gallery_dl-1.14.3.dev0-py3.8.egg/gallery_dl/extractor/common.py", line 441, in items
page = self.request(self.manga_url).text
File "/usr/local/lib/python3.8/dist-packages/gallery_dl-1.14.3.dev0-py3.8.egg/gallery_dl/extractor/kissmanga.py", line 24, in request
response = Extractor.request(self, url, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/gallery_dl-1.14.3.dev0-py3.8.egg/gallery_dl/extractor/common.py", line 109, in request
response, domain, cookies = cloudflare.solve_challenge(
File "/usr/local/lib/python3.8/dist-packages/gallery_dl-1.14.3.dev0-py3.8.egg/gallery_dl/cloudflare.py", line 61, in solve_challenge
value = solve_js_challenge(page, parsed.netloc)
File "/usr/local/lib/python3.8/dist-packages/gallery_dl-1.14.3.dev0-py3.8.egg/gallery_dl/cloudflare.py", line 107, in solve_js_challenge
solution = evaluate_expression(data["expr"], page, netloc)
File "/usr/local/lib/python3.8/dist-packages/gallery_dl-1.14.3.dev0-py3.8.egg/gallery_dl/cloudflare.py", line 174, in evaluate_expression
value += VALUES[part]
KeyError: ' 100%; height: 100%; margin: 0; padding: 0;'

@CaptainJawZ
Copy link

CaptainJawZ commented Jul 8, 2020

The same thing happens in readcomicsonline which I believe is from the same people.

[gallery-dl][debug] Python 3.8.3 - Windows-10-10.0.19041-SP0
[gallery-dl][debug] requests 2.24.0 - urllib3 1.25.9
[gallery-dl][debug] Starting DownloadJob for 'https://readcomiconline.to/Comic/Harley-Quinn-2016/Issue-74?id=173102'
[readcomiconline][debug] Using ReadcomiconlineIssueExtractor for 'https://readcomiconline.to/Comic/Harley-Quinn-2016/Issue-74?id=173102'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): readcomiconline.to:443
[urllib3.connectionpool][debug] https://readcomiconline.to:443 "GET /Comic/Harley-Quinn-2016/Issue-74?id=173102 HTTP/1.1" 503 None
[readcomiconline][info] Solving Cloudflare challenge
[urllib3.connectionpool][debug] Resetting dropped connection: readcomiconline.to
[urllib3.connectionpool][debug] https://readcomiconline.to:443 "GET /cdn-cgi/images/trace/jschal/nojs/transparent.gif?ray=5af5c07ade8dec2e HTTP/1.1" 200 42
[urllib3.connectionpool][debug] https://readcomiconline.to:443 "GET /cdn-cgi/images/trace/jschal/js/nocookie/transparent.gif?ray=5af5c07ade8dec2e HTTP/1.1" 200 42
[readcomiconline][error] An unexpected error occurred: KeyError - ' 100%; height: 100%; margin: 0; padding: 0;'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[readcomiconline][debug]
Traceback (most recent call last):
  File "c:\python38\lib\site-packages\gallery_dl\job.py", line 61, in run
    for msg in self.extractor:
  File "c:\python38\lib\site-packages\gallery_dl\extractor\common.py", line 375, in items
    page = self.request(self.gallery_url, notfound=self.subcategory).text
  File "c:\python38\lib\site-packages\gallery_dl\extractor\kissmanga.py", line 24, in request
    response = Extractor.request(self, url, **kwargs)
  File "c:\python38\lib\site-packages\gallery_dl\extractor\common.py", line 109, in request
    response, domain, cookies = cloudflare.solve_challenge(
  File "c:\python38\lib\site-packages\gallery_dl\cloudflare.py", line 61, in solve_challenge
    value = solve_js_challenge(page, parsed.netloc)
  File "c:\python38\lib\site-packages\gallery_dl\cloudflare.py", line 107, in solve_js_challenge
    solution = evaluate_expression(data["expr"], page, netloc)
  File "c:\python38\lib\site-packages\gallery_dl\cloudflare.py", line 174, in evaluate_expression
    value += VALUES[part]
KeyError: ' 100%; height: 100%; margin: 0; padding: 0;'```

Also I noticed it doesn't happen 100% of the time, there are instances where it doesn't happen, like if you try 10 times the same commant maybe 9 times you will get the error, and 1 time will go through, so maybe a way to boycot this is to loop the command if said error occurs a x amount of times until it passes through? 

@kattjevfel
Copy link
Contributor

I'd just like to point out you should do ``` (on its own line) instead of a single ` to make output not look like horror.

mikf added a commit that referenced this issue Jul 9, 2020
The relatively new v2 challenges aren't supported (*), but retrying
often enough may yield a v1 challenge which can be solved.

(*) and probably never will. They are far too complicated to do without
a real browser.
@mikf
Copy link
Owner

mikf commented Jul 9, 2020

This is due to Cloudflare's new "Checking your browser before accessing kissmanga.com." challenge to keep potential bots out. This new version is basically unsolvable without a real browser, but as @CaptainJawZ noted, sometimes one still gets the old solvable challenge.

To get around this, you need to

  • get past this page in your web browser
  • set gallery-dl's user-agent string to the same value your browser has
  • export your browser's cookies for kissmanga.com
  • feed them to gallery-dl when downloading from kissmanga

@mikf
Copy link
Owner

mikf commented Oct 15, 2020

kissmanga.com is gone and its code was removed in c874071

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants