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

[mangadex][error] An unexpected error occurred: KeyError - 'data' #2177

Closed
fsktom opened this issue Jan 8, 2022 · 2 comments
Closed

[mangadex][error] An unexpected error occurred: KeyError - 'data' #2177

fsktom opened this issue Jan 8, 2022 · 2 comments

Comments

@fsktom
Copy link

fsktom commented Jan 8, 2022

Hi. I got the following error when trying to download chapters from MangaDex

$ gallery-dl -v https://mangadex.org/chapter/6c2e552c-32b3-4c08-9fd8-ddd5a97d0d7a
[gallery-dl][debug] Version 1.20.0
[gallery-dl][debug] Python 3.9.5 - Windows-10-10.0.19043-SP0
[gallery-dl][debug] requests 2.25.1 - urllib3 1.26.6
[gallery-dl][debug] Starting DownloadJob for 'https://mangadex.org/chapter/6c2e552c-32b3-4c08-9fd8-ddd5a97d0d7a'
[mangadex][debug] Using MangadexChapterExtractor for 'https://mangadex.org/chapter/6c2e552c-32b3-4c08-9fd8-ddd5a97d0d7a'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.mangadex.org:443
[urllib3.connectionpool][debug] https://api.mangadex.org:443 "GET /chapter/6c2e552c-32b3-4c08-9fd8-ddd5a97d0d7a?includes%5B%5D=scanlation_group HTTP/1.1" 200 790
[urllib3.connectionpool][debug] https://api.mangadex.org:443 "GET /manga/e78a489b-6632-4d61-b00b-5206f5b8b22b?includes%5B%5D=artist&includes%5B%5D=author HTTP/1.1" 200 3090
[mangadex][error] An unexpected error occurred: KeyError - 'data'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[mangadex][debug]
Traceback (most recent call last):
  File "d:\software\miniconda\lib\site-packages\gallery_dl\extractor\mangadex.py", line 110, in items
    chapter, data = self._cache.pop(self.uuid)
KeyError: '6c2e552c-32b3-4c08-9fd8-ddd5a97d0d7a'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "d:\software\miniconda\lib\site-packages\gallery_dl\job.py", line 79, in run
    for msg in extractor:
  File "d:\software\miniconda\lib\site-packages\gallery_dl\extractor\mangadex.py", line 113, in items
    data = self._transform(chapter)
  File "d:\software\miniconda\lib\site-packages\gallery_dl\extractor\mangadex.py", line 75, in _transform
    "count"   : len(cattributes["data"]),
KeyError: 'data'

This error seems to occur to me for every chapter of every manga. Tested it on 10+ titles, and on none of them did the extraction work.
I looked at the titles of the commits after the last update, and it doesn't seem like this was addressed. Maybe I missed something. Or possibly it's just an error on my machine?
Ask me if you need any more help/details. I would be very glad and thankful if you were able to fix this bug(?).

@L1ckMyP4w5
Copy link

Started getting the same error just this morning. Mangadex api most likely changed as I was downloading stuff fine this past january 6th with the same gallery-dl version (1.20.0).
Here's the error dump. I'm on mac osx.

[gallery-dl][debug] Version 1.20.0
[gallery-dl][debug] Python 3.7.6 - Darwin-19.6.0-x86_64-i386-64bit
[gallery-dl][debug] requests 2.26.0 - urllib3 1.26.7
[gallery-dl][debug] Starting DownloadJob for 'https://mangadex.org/title/3cb067f8-d042-4fa0-bd83-86ca7a4e04e8/yuri-to-hitsugi'
[mangadex][debug] Using MangadexMangaExtractor for 'https://mangadex.org/title/3cb067f8-d042-4fa0-bd83-86ca7a4e04e8/yuri-to-hitsugi'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.mangadex.org:443
[urllib3.connectionpool][debug] https://api.mangadex.org:443 "GET /manga/3cb067f8-d042-4fa0-bd83-86ca7a4e04e8/feed?order%5Bvolume%5D=asc&order%5Bchapter%5D=asc&contentRating%5B%5D=safe&contentRating%5B%5D=suggestive&contentRating%5B%5D=erotica&contentRating%5B%5D=pornographic&includes%5B%5D=scanlation_group&offset=0 HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://api.mangadex.org:443 "GET /manga/3cb067f8-d042-4fa0-bd83-86ca7a4e04e8?includes%5B%5D=artist&includes%5B%5D=author HTTP/1.1" 200 891
[mangadex][error] An unexpected error occurred: KeyError - 'data'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[mangadex][debug]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/gallery_dl/job.py", line 79, in run
for msg in extractor:
File "/usr/local/lib/python3.7/site-packages/gallery_dl/extractor/mangadex.py", line 41, in items
data = self._transform(chapter)
File "/usr/local/lib/python3.7/site-packages/gallery_dl/extractor/mangadex.py", line 75, in _transform
"count" : len(cattributes["data"]),
KeyError: 'data'

@mikf mikf closed this as completed in 170711a Jan 8, 2022
@mikf mikf pinned this issue Jan 8, 2022
@fsktom
Copy link
Author

fsktom commented Jan 8, 2022

Thank you so much for the very fast fix @mikf ! :D

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

No branches or pull requests

3 participants