mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.56k stars 947 forks source link

Unexpected error KeyError -'+(!!' #728

Closed Metichi closed 4 years ago

Metichi commented 4 years ago

I am trying to download a manga from kissmanga and I run into this error and get told to report it here. Im using the gallery-dl standalone executable v1.13.5 on ubuntu 20.04

Here is the output

gallery-dl https://kissmanga.com/Manga/Dungeon-Meshi/Ch-063----Confit?id=610531 --verbose
[gallery-dl][debug] Version 1.13.5
[gallery-dl][debug] Python 3.8.2 - Linux-5.4.0-28-generic-x86_64-with-glibc2.4
[gallery-dl][debug] requests 2.23.0 - urllib3 1.25.8
[gallery-dl][debug] Starting DownloadJob for 'https://kissmanga.com/Manga/Dungeon-Meshi/Ch-063----Confit?id=610531'
[kissmanga][debug] Using KissmangaChapterExtractor for 'https://kissmanga.com/Manga/Dungeon-Meshi/Ch-063----Confit?id=610531'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): kissmanga.com:443
[urllib3.connectionpool][debug] https://kissmanga.com:443 "GET /Manga/Dungeon-Meshi/Ch-063----Confit?id=610531 HTTP/1.1" 503 None
[kissmanga][info] Solving Cloudflare challenge
[kissmanga][error] An unexpected error occurred: KeyError - '+(!!'. 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 "gallery_dl/job.py", line 49, in run
  File "gallery_dl/extractor/common.py", line 343, in items
  File "gallery_dl/extractor/kissmanga.py", line 24, in request
  File "gallery_dl/extractor/common.py", line 106, in request
  File "gallery_dl/cloudflare.py", line 47, in solve_challenge
  File "gallery_dl/cloudflare.py", line 88, in solve_js_challenge
  File "gallery_dl/cloudflare.py", line 130, in evaluate_expression
  File "gallery_dl/cloudflare.py", line 148, in evaluate_expression
  File "gallery_dl/cloudflare.py", line 149, in <genexpr>
KeyError: '+(!!'
mikf commented 4 years ago

Thanks for reporting. Should be fixed in the new release (commit https://github.com/mikf/gallery-dl/commit/714566b6e3e507338bad4a84e9333eb9ba31fa9e)

God-damnit-all commented 4 years ago

I'm having a similar error today, also from kissmanga. Tried updating to the latest dev version and it didn't help. Was working fine on a few days ago.

Traceback (most recent call last):
  File "c:\python37\lib\site-packages\gallery_dl\job.py", line 55, in run
    for msg in self.extractor:
  File "c:\python37\lib\site-packages\gallery_dl\extractor\common.py", line 430, in items
    page = self.request(self.manga_url).text
  File "c:\python37\lib\site-packages\gallery_dl\extractor\kissmanga.py", line 24, in request
    response = Extractor.request(self, url, **kwargs)
  File "c:\python37\lib\site-packages\gallery_dl\extractor\common.py", line 110, in request
    session, response, kwargs)
  File "c:\python37\lib\site-packages\gallery_dl\cloudflare.py", line 47, in solve_challenge
    value = solve_js_challenge(page, parsed.netloc)
  File "c:\python37\lib\site-packages\gallery_dl\cloudflare.py", line 100, in solve_js_challenge
    value = evaluate_expression(expr[vlength+2:], page, netloc)
  File "c:\python37\lib\site-packages\gallery_dl\cloudflare.py", line 123, in evaluate_expression
    return evaluate_expression(e.partition(">")[2], page, netloc)
AttributeError: 'NoneType' object has no attribute 'partition'
mikf commented 4 years ago

@ImportTaste Cloudflare changed its "Checking your browser before accessing kissmanga.com" challenge again. Should be fixed with https://github.com/mikf/gallery-dl/commit/d17e9628b312da15335cdb50bd5d93fd8c2e538d