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

Kissmanga: An unexpected error occurred: AttributeError - 'NoneType' object has no attribute 'partition'. #757

Closed arisboch closed 4 years ago

arisboch commented 4 years ago

When I tried to download a manga series via the URL https://kissmanga.com/Manga/Kiniro-Mosaic , it gave me the following error message:

[gallery-dl][debug] Version 1.14.0-dev
[gallery-dl][debug] Python 3.8.2 - Linux-4.4.0-18362-Microsoft-x86_64-with-glibc2.29
[gallery-dl][debug] requests 2.22.0 - urllib3 1.25.8
[gallery-dl][debug] Starting DownloadJob for 'https://kissmanga.com/Manga/Kiniro-Mosaic'
[kissmanga][debug] Using KissmangaMangaExtractor for 'https://kissmanga.com/Manga/Kiniro-Mosaic'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): kissmanga.com:443
[urllib3.connectionpool][debug] https://kissmanga.com:443 "GET /Manga/Kiniro-Mosaic HTTP/1.1" 503 None
[kissmanga][info] Solving Cloudflare challenge
[kissmanga][error] An unexpected error occurred: AttributeError - 'NoneType' object has no attribute 'partition'. 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/job.py", line 55, in run
    for msg in self.extractor:
  File "/usr/local/lib/python3.8/dist-packages/gallery_dl/extractor/common.py", line 430, in items
    page = self.request(self.manga_url).text
  File "/usr/local/lib/python3.8/dist-packages/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/extractor/common.py", line 109, in request
    response, domain, cookies = cloudflare.solve_challenge(
  File "/usr/local/lib/python3.8/dist-packages/gallery_dl/cloudflare.py", line 47, in solve_challenge
    value = solve_js_challenge(page, parsed.netloc)
  File "/usr/local/lib/python3.8/dist-packages/gallery_dl/cloudflare.py", line 100, in solve_js_challenge
    value = evaluate_expression(expr[vlength+2:], page, netloc)
  File "/usr/local/lib/python3.8/dist-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'

I tried a few others such as these (by random):

https://kissmanga.com/Manga/Talk-to-Me https://kissmanga.com/Manga/Cat-Eared-Girl https://kissmanga.com/Manga/Yubisaki-Milk-Tea https://kissmanga.com/Manga/Dramatic-Irony--Namaco

To no avail, all of them produce the same error message.

mikf commented 4 years ago

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