Skip to content

Some downloads fail from MangaDex: KeyError: 'ja-ro' #110

Description

@barracuda156

What broke?

  • Downloader
  • Processor
  • Converter
  • Other

Mandown version
Output of mandown --version:
mandown 1.12.2

Describe the bug
I tried to download two titles from MangaDex, and one worked as expected, while another failed, see the log below.

Steps to reproduce
mandown get https://mangadex.org/title/06338c21-dfd9-4ab0-a0c6-1d973821b992/bad-girl

Additional context

% mandown get https://mangadex.org/title/06338c21-dfd9-4ab0-a0c6-1d973821b992/bad-girl
Searching sources for https://mangadex.org/title/06338c21-dfd9-4ab0-a0c6-1d973821b992/bad-girl
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ │
│ site-packages/mandown/cli.py:417 in get                                      │
│                                                                              │
│   414 │   size_profile = cast(SupportedProfiles | None, size_profile)        │
│   415 │                                                                      │
│   416 │   # get and save metadata                                            │
│ ❱ 417 │   comic = cli_query(url)                                             │
│   418 │                                                                      │
│   419 │   typer.echo(                                                        │
│   420 │   │   f'Found comic "{comic.metadata.title}" from source {sources.ge │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │         convert_to = <ConvertFormats.NONE: 'none'>                       │ │
│ │               dest = PosixPath('/Users/svacchanda')                      │ │
│ │                end = None                                                │ │
│ │         maxthreads = 4                                                   │ │
│ │ processing_options = []                                                  │ │
│ │       remove_after = False                                               │ │
│ │       size_profile = None                                                │ │
│ │  split_by_chapters = False                                               │ │
│ │              start = None                                                │ │
│ │        target_size = None                                                │ │
│ │                url = 'https://mangadex.org/title/06338c21-dfd9-4ab0-a0c… │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ │
│ site-packages/mandown/cli.py:140 in cli_query                                │
│                                                                              │
│   137 │   typer.echo(f"Searching sources for {url}")                         │
│   138 │                                                                      │
│   139 │   try:                                                               │
│ ❱ 140 │   │   comic = api.query(url)                                         │
│   141 │   except ValueError as err:                                          │
│   142 │   │   typer.secho("Could not match URL with available sources.", fg= │
│   143 │   │   raise typer.Exit(1) from err                                   │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ url = 'https://mangadex.org/title/06338c21-dfd9-4ab0-a0c6-1d973821b992/… │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ │
│ site-packages/mandown/api.py:23 in query                                     │
│                                                                              │
│    20 │   :raises `ValueError` if the source is not found.                   │
│    21 │   """                                                                │
│    22 │   adapter = sources.get_class_for(url)(url)                          │
│ ❱  23 │   return BaseComic(adapter.metadata, adapter.chapters)               │
│    24                                                                        │
│    25                                                                        │
│    26 def load(path: Path | str) -> BaseComic:                               │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ adapter = <mandown.sources.source_mangadex.MangaDexSource object at      │ │
│ │           0x1074f06e0>                                                   │ │
│ │     url = 'https://mangadex.org/title/06338c21-dfd9-4ab0-a0c6-1d973821b… │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ │
│ site-packages/mandown/sources/base_source.py:30 in metadata                  │
│                                                                              │
│    27 │   │   """                                                            │
│    28 │   │   if self._metadata:                                             │
│    29 │   │   │   return self._metadata                                      │
│ ❱  30 │   │   self._metadata = self.fetch_metadata()                         │
│    31 │   │   return self._metadata                                          │
│    32 │                                                                      │
│    33 │   @final                                                             │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ self = <mandown.sources.source_mangadex.MangaDexSource object at         │ │
│ │        0x1074f06e0>                                                      │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ │
│ site-packages/mandown/sources/base_source.py:49 in fetch_metadata            │
│                                                                              │
│    46 │   │   """                                                            │
│    47 │   │   Fetch and return title, author, and url of the comic.          │
│    48 │   │   """                                                            │
│ ❱  49 │   │   return self._fetch_metadata()                                  │
│    50 │                                                                      │
│    51 │   @final                                                             │
│    52 │   def fetch_chapter_list(self) -> list[BaseChapter]:                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ self = <mandown.sources.source_mangadex.MangaDexSource object at         │ │
│ │        0x1074f06e0>                                                      │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ │
│ site-packages/mandown/sources/source_mangadex.py:52 in _fetch_metadata       │
│                                                                              │
│    49 │   │   title: str = metadata["attributes"]["title"][self.lang_code]   │
│    50 │   │                                                                  │
│    51 │   │   if metadata["attributes"]["description"]:                      │
│ ❱  52 │   │   │   description: str = metadata["attributes"]["description"][s │
│    53 │   │   │                                                              │
│    54 │   │   │   # strip trailing spaces on each line                       │
│    55 │   │   │   description = "\n".join(s.strip() for s in description.spl │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ metadata = {                                                             │ │
│ │            │   'id': '06338c21-dfd9-4ab0-a0c6-1d973821b992',             │ │
│ │            │   'type': 'manga',                                          │ │
│ │            │   'attributes': {                                           │ │
│ │            │   │   'title': {'ja-ro': 'Bad Girl'},                       │ │
│ │            │   │   'altTitles': [                                        │ │
│ │            │   │   │   {'ja': 'ばっどがーる'},                           │ │
│ │            │   │   │   {'ko': '배드 걸'}                                 │ │
│ │            │   │   ],                                                    │ │
│ │            │   │   'description': {                                      │ │
│ │            │   │   │   'en': 'The daily life of a (self-proclaimed) high │ │
│ │            school delinquent, fangirling and koh'+513,                   │ │
│ │            │   │   │   'ja':                                             │ │
│ │            '(自称)不良高校生、風紀委員長にコヒュらされる日々!?※「コヒ… │ │
│ │            │   │   },                                                    │ │
│ │            │   │   'isLocked': False,                                    │ │
│ │            │   │   'links': {                                            │ │
│ │            │   │   │   'al': '131790',                                   │ │
│ │            │   │   │   'ap': 'bad-girl',                                 │ │
│ │            │   │   │   'bw': 'series/337580/list',                       │ │
│ │            │   │   │   'kt': '62691',                                    │ │
│ │            │   │   │   'mu': 'vfcqnsm',                                  │ │
│ │            │   │   │   'amz': 'https://www.amazon.co.jp/dp/B0BKV7FV1N',  │ │
│ │            │   │   │   'ebj':                                            │ │
│ │            'https://ebookjapan.yahoo.co.jp/books/680173',                │ │
│ │            │   │   │   'mal': '144290',                                  │ │
│ │            │   │   │   'raw': 'https://comic-fuz.com/book/26007',        │ │
│ │            │   │   │   'engtl': 'https://yenpress.com/series/bad-girl'   │ │
│ │            │   │   },                                                    │ │
│ │            │   │   'officialLinks': None,                                │ │
│ │            │   │   'originalLanguage': 'ja',                             │ │
│ │            │   │   'lastVolume': '',                                     │ │
│ │            │   │   'lastChapter': '',                                    │ │
│ │            │   │   'publicationDemographic': 'seinen',                   │ │
│ │            │   │   ... +11                                               │ │
│ │            │   },                                                        │ │
│ │            │   'relationships': [                                        │ │
│ │            │   │   {                                                     │ │
│ │            │   │   │   'id': '69b231b2-8559-4f55-b2a1-5df6411bbe46',     │ │
│ │            │   │   │   'type': 'author',                                 │ │
│ │            │   │   │   'attributes': {                                   │ │
│ │            │   │   │   │   'name': 'Nikumaru',                           │ │
│ │            │   │   │   │   'imageUrl': None,                             │ │
│ │            │   │   │   │   'biography': {                                │ │
│ │            │   │   │   │   │   'en': '**Name In Native Language:** 肉丸' │ │
│ │            │   │   │   │   },                                            │ │
│ │            │   │   │   │   'twitter':                                    │ │
│ │            'https://twitter.com/nikumarusuisann',                        │ │
│ │            │   │   │   │   'pixiv':                                      │ │
│ │            'https://www.pixiv.net/users/3262520',                        │ │
│ │            │   │   │   │   'melonBook': None,                            │ │
│ │            │   │   │   │   'fanBox': None,                               │ │
│ │            │   │   │   │   'booth': None,                                │ │
│ │            │   │   │   │   'namicomi': None,                             │ │
│ │            │   │   │   │   'nicoVideo': None,                            │ │
│ │            │   │   │   │   ... +10                                       │ │
│ │            │   │   │   }                                                 │ │
│ │            │   │   },                                                    │ │
│ │            │   │   {                                                     │ │
│ │            │   │   │   'id': '69b231b2-8559-4f55-b2a1-5df6411bbe46',     │ │
│ │            │   │   │   'type': 'artist',                                 │ │
│ │            │   │   │   'attributes': {                                   │ │
│ │            │   │   │   │   'name': 'Nikumaru',                           │ │
│ │            │   │   │   │   'imageUrl': None,                             │ │
│ │            │   │   │   │   'biography': {                                │ │
│ │            │   │   │   │   │   'en': '**Name In Native Language:** 肉丸' │ │
│ │            │   │   │   │   },                                            │ │
│ │            │   │   │   │   'twitter':                                    │ │
│ │            'https://twitter.com/nikumarusuisann',                        │ │
│ │            │   │   │   │   'pixiv':                                      │ │
│ │            'https://www.pixiv.net/users/3262520',                        │ │
│ │            │   │   │   │   'melonBook': None,                            │ │
│ │            │   │   │   │   'fanBox': None,                               │ │
│ │            │   │   │   │   'booth': None,                                │ │
│ │            │   │   │   │   'namicomi': None,                             │ │
│ │            │   │   │   │   'nicoVideo': None,                            │ │
│ │            │   │   │   │   ... +10                                       │ │
│ │            │   │   │   }                                                 │ │
│ │            │   │   },                                                    │ │
│ │            │   │   {                                                     │ │
│ │            │   │   │   'id': 'ff204723-1033-4d56-b845-d61c76a122cd',     │ │
│ │            │   │   │   'type': 'cover_art',                              │ │
│ │            │   │   │   'attributes': {                                   │ │
│ │            │   │   │   │   'description': '',                            │ │
│ │            │   │   │   │   'volume': '5',                                │ │
│ │            │   │   │   │   'fileName':                                   │ │
│ │            '02376cd6-cbd3-475b-984f-d2cbb514aa60.jpg',                   │ │
│ │            │   │   │   │   'locale': 'ja',                               │ │
│ │            │   │   │   │   'createdAt': '2025-07-15T06:23:26+00:00',     │ │
│ │            │   │   │   │   'updatedAt': '2025-07-15T06:23:26+00:00',     │ │
│ │            │   │   │   │   'version': 1                                  │ │
│ │            │   │   │   }                                                 │ │
│ │            │   │   },                                                    │ │
│ │            │   │   {                                                     │ │
│ │            │   │   │   'id': '3b4a9a04-07b8-40fa-80a5-d361f95e37d1',     │ │
│ │            │   │   │   'type': 'manga',                                  │ │
│ │            │   │   │   'related': 'side_story'                           │ │
│ │            │   │   },                                                    │ │
│ │            │   │   {                                                     │ │
│ │            │   │   │   'id': '176af0d5-4dc5-4c81-abcd-09aaf3bc2406',     │ │
│ │            │   │   │   'type': 'creator'                                 │ │
│ │            │   │   }                                                     │ │
│ │            │   ]                                                         │ │
│ │            }                                                             │ │
│ │        r = {                                                             │ │
│ │            │   'result': 'ok',                                           │ │
│ │            │   'response': 'entity',                                     │ │
│ │            │   'data': {                                                 │ │
│ │            │   │   'id': '06338c21-dfd9-4ab0-a0c6-1d973821b992',         │ │
│ │            │   │   'type': 'manga',                                      │ │
│ │            │   │   'attributes': {                                       │ │
│ │            │   │   │   'title': {'ja-ro': 'Bad Girl'},                   │ │
│ │            │   │   │   'altTitles': [                                    │ │
│ │            │   │   │   │   {'ja': 'ばっどがーる'},                       │ │
│ │            │   │   │   │   {'ko': '배드 걸'}                             │ │
│ │            │   │   │   ],                                                │ │
│ │            │   │   │   'description': {                                  │ │
│ │            │   │   │   │   'en': 'The daily life of a (self-proclaimed)  │ │
│ │            high school delinquent, fangirling and koh'+513,              │ │
│ │            │   │   │   │   'ja':                                         │ │
│ │            '(自称)不良高校生、風紀委員長にコヒュらされる日々!?※「コヒ… │ │
│ │            │   │   │   },                                                │ │
│ │            │   │   │   'isLocked': False,                                │ │
│ │            │   │   │   'links': {                                        │ │
│ │            │   │   │   │   'al': '131790',                               │ │
│ │            │   │   │   │   'ap': 'bad-girl',                             │ │
│ │            │   │   │   │   'bw': 'series/337580/list',                   │ │
│ │            │   │   │   │   'kt': '62691',                                │ │
│ │            │   │   │   │   'mu': 'vfcqnsm',                              │ │
│ │            │   │   │   │   'amz':                                        │ │
│ │            'https://www.amazon.co.jp/dp/B0BKV7FV1N',                     │ │
│ │            │   │   │   │   'ebj':                                        │ │
│ │            'https://ebookjapan.yahoo.co.jp/books/680173',                │ │
│ │            │   │   │   │   'mal': '144290',                              │ │
│ │            │   │   │   │   'raw': 'https://comic-fuz.com/book/26007',    │ │
│ │            │   │   │   │   'engtl':                                      │ │
│ │            'https://yenpress.com/series/bad-girl'                        │ │
│ │            │   │   │   },                                                │ │
│ │            │   │   │   'officialLinks': None,                            │ │
│ │            │   │   │   'originalLanguage': 'ja',                         │ │
│ │            │   │   │   'lastVolume': '',                                 │ │
│ │            │   │   │   'lastChapter': '',                                │ │
│ │            │   │   │   'publicationDemographic': 'seinen',               │ │
│ │            │   │   │   ... +11                                           │ │
│ │            │   │   },                                                    │ │
│ │            │   │   'relationships': [                                    │ │
│ │            │   │   │   {                                                 │ │
│ │            │   │   │   │   'id': '69b231b2-8559-4f55-b2a1-5df6411bbe46', │ │
│ │            │   │   │   │   'type': 'author',                             │ │
│ │            │   │   │   │   'attributes': {                               │ │
│ │            │   │   │   │   │   'name': 'Nikumaru',                       │ │
│ │            │   │   │   │   │   'imageUrl': None,                         │ │
│ │            │   │   │   │   │   'biography': {                            │ │
│ │            │   │   │   │   │   │   'en': '**Name In Native Language:**   │ │
│ │            肉丸'                                                         │ │
│ │            │   │   │   │   │   },                                        │ │
│ │            │   │   │   │   │   'twitter':                                │ │
│ │            'https://twitter.com/nikumarusuisann',                        │ │
│ │            │   │   │   │   │   'pixiv':                                  │ │
│ │            'https://www.pixiv.net/users/3262520',                        │ │
│ │            │   │   │   │   │   'melonBook': None,                        │ │
│ │            │   │   │   │   │   'fanBox': None,                           │ │
│ │            │   │   │   │   │   'booth': None,                            │ │
│ │            │   │   │   │   │   'namicomi': None,                         │ │
│ │            │   │   │   │   │   'nicoVideo': None,                        │ │
│ │            │   │   │   │   │   ... +10                                   │ │
│ │            │   │   │   │   }                                             │ │
│ │            │   │   │   },                                                │ │
│ │            │   │   │   {                                                 │ │
│ │            │   │   │   │   'id': '69b231b2-8559-4f55-b2a1-5df6411bbe46', │ │
│ │            │   │   │   │   'type': 'artist',                             │ │
│ │            │   │   │   │   'attributes': {                               │ │
│ │            │   │   │   │   │   'name': 'Nikumaru',                       │ │
│ │            │   │   │   │   │   'imageUrl': None,                         │ │
│ │            │   │   │   │   │   'biography': {                            │ │
│ │            │   │   │   │   │   │   'en': '**Name In Native Language:**   │ │
│ │            肉丸'                                                         │ │
│ │            │   │   │   │   │   },                                        │ │
│ │            │   │   │   │   │   'twitter':                                │ │
│ │            'https://twitter.com/nikumarusuisann',                        │ │
│ │            │   │   │   │   │   'pixiv':                                  │ │
│ │            'https://www.pixiv.net/users/3262520',                        │ │
│ │            │   │   │   │   │   'melonBook': None,                        │ │
│ │            │   │   │   │   │   'fanBox': None,                           │ │
│ │            │   │   │   │   │   'booth': None,                            │ │
│ │            │   │   │   │   │   'namicomi': None,                         │ │
│ │            │   │   │   │   │   'nicoVideo': None,                        │ │
│ │            │   │   │   │   │   ... +10                                   │ │
│ │            │   │   │   │   }                                             │ │
│ │            │   │   │   },                                                │ │
│ │            │   │   │   {                                                 │ │
│ │            │   │   │   │   'id': 'ff204723-1033-4d56-b845-d61c76a122cd', │ │
│ │            │   │   │   │   'type': 'cover_art',                          │ │
│ │            │   │   │   │   'attributes': {                               │ │
│ │            │   │   │   │   │   'description': '',                        │ │
│ │            │   │   │   │   │   'volume': '5',                            │ │
│ │            │   │   │   │   │   'fileName':                               │ │
│ │            '02376cd6-cbd3-475b-984f-d2cbb514aa60.jpg',                   │ │
│ │            │   │   │   │   │   'locale': 'ja',                           │ │
│ │            │   │   │   │   │   'createdAt': '2025-07-15T06:23:26+00:00', │ │
│ │            │   │   │   │   │   'updatedAt': '2025-07-15T06:23:26+00:00', │ │
│ │            │   │   │   │   │   'version': 1                              │ │
│ │            │   │   │   │   }                                             │ │
│ │            │   │   │   },                                                │ │
│ │            │   │   │   {                                                 │ │
│ │            │   │   │   │   'id': '3b4a9a04-07b8-40fa-80a5-d361f95e37d1', │ │
│ │            │   │   │   │   'type': 'manga',                              │ │
│ │            │   │   │   │   'related': 'side_story'                       │ │
│ │            │   │   │   },                                                │ │
│ │            │   │   │   {                                                 │ │
│ │            │   │   │   │   'id': '176af0d5-4dc5-4c81-abcd-09aaf3bc2406', │ │
│ │            │   │   │   │   'type': 'creator'                             │ │
│ │            │   │   │   }                                                 │ │
│ │            │   │   ]                                                     │ │
│ │            │   }                                                         │ │
│ │            }                                                             │ │
│ │     self = <mandown.sources.source_mangadex.MangaDexSource object at     │ │
│ │            0x1074f06e0>                                                  │ │
│ │    title = 'Bad Girl'                                                    │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
KeyError: 'ja-ro'

At the same time this worked fine:

% mandown get https://mangadex.org/title/c384faed-e34c-4ee0-bd38-70ce5ff146c7/grapara
Searching sources for https://mangadex.org/title/c384faed-e34c-4ee0-bd38-70ce5ff146c7/grapara
Found comic "GraPara!" from source MangaDex
Downloading 39 chapter(s)...
A Girl Who Offers Sex for Favors  [###---------------------------------]   10%  Time to Dig In! ♥  [####--------------------------------]   12%  00:02:23       Afterwards, Sakura Cried  [#####-------------------------------]   15%  00:02:23Congratulations on your AV Debut!  [######------------------------------]   17% Overflowing From Mio's Slit  [#######-----------------------------]   20%  00:02My First XXX  [########----------------------------]   23%  00:02:28            A New Adulterer  [#########---------------------------]   25%  00:02:26         Secret Lymphatic Massage  [##########--------------------------]   28%  00:02:20Becoming a Woman  [###########-------------------------]   30%  00:02:15        Naked Argument  [############------------------------]   33%  00:02:10          Muutan's Trap  [############------------------------]   35%  00:02:05           Three Lewd Games  [#############-----------------------]   38%  00:01:59        First Experience  [##############----------------------]   41%  00:01:54        Leak Incident  [###############---------------------]   43%  00:01:49           If Ayu didn't come...  [################--------------------]   46%  00:01:43   Climax Grand Prix  [#################-------------------]   48%  00:01:38       Perverted Producer  [##################------------------]   51%  00:01:32      Fucking on the First Day  [###################-----------------]   53%  00:01:27Love Triangle  [####################----------------]   56%  00:01:21           Wriggling Tentacle Paradise  [#####################---------------]   58%  00:01Please Take Your Bottoms Off  [######################--------------]   61%  00:0Exposed Beach Volleyball  [#######################-------------]   64%  00:01:06Her Request  [########################------------]   66%  00:01:01             Touch Me... More  [########################------------]   69%  00:00:56        Slurp Slurp  [#########################-----------]   71%  00:00:51             NTR Photo Session  [##########################----------]   74%  00:00:47       Girls are… amazing!  [###########################---------]   76%  00:00:42     Toppy Awakens  [############################--------]   79%  00:00:37           Toppy’s women bath challenge.  [#############################-------]   82%  00:Unrivaled Toppy  [##############################------]   84%  00:00:28         Secret Sliding Operation  [###############################-----]   87%  00:00:23Mutual Love  [################################----]   89%  00:00:19             Empty heart  [#################################---]   92%  00:00:14             Meanwhile, at the Mansion.  [##################################--]   94%  00:00:Toppy, joins in!  [###################################-]   97%  00:00:04        Humiliation Play  [####################################]  100%                           
Successfully downloaded 39 chapter(s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions