From 214acc39e69ebaf120d51c1d9d7d3d4dc6ba9556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 11 Oct 2025 15:06:26 +0200 Subject: [PATCH] [mangadex] fix 'RuntimeError' for titles without a 'description' (#8389) fixes regression introduced in 0a76cbc8c7caeec95494472f2fa4a82437ad11f4 --- gallery_dl/extractor/mangadex.py | 4 ++-- test/results/mangadex.py | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/mangadex.py b/gallery_dl/extractor/mangadex.py index 30d68482..16eb6505 100644 --- a/gallery_dl/extractor/mangadex.py +++ b/gallery_dl/extractor/mangadex.py @@ -450,13 +450,13 @@ def _manga_info(self, uuid): return { "manga" : (mattr["title"].get("en") or - next(iter(mattr["title"].values()))), + next(iter(mattr["title"].values()), "")), "manga_id": manga["id"], "manga_titles": [t.popitem()[1] for t in mattr.get("altTitles") or ()], "manga_date" : text.parse_datetime(mattr.get("createdAt")), "description" : (mattr["description"].get("en") or - next(iter(mattr["description"].values()))), + next(iter(mattr["description"].values()), "")), "demographic": mattr.get("publicationDemographic"), "origin": mattr.get("originalLanguage"), "status": mattr.get("status"), diff --git a/test/results/mangadex.py b/test/results/mangadex.py index 49149956..5309db13 100644 --- a/test/results/mangadex.py +++ b/test/results/mangadex.py @@ -178,6 +178,15 @@ __tests__ = ( "#count" : ">= 20", }, +{ + "#url" : "https://mangadex.org/title/2e73a1ac-bf26-4c04-84f6-d0a22fd37624/tomodachi-no-joshi-ni-josou-saserare-danshi", + "#comment" : "no 'description' (#8389)", + "#class" : mangadex.MangadexMangaExtractor, + "#count" : 47, + + "description": "", +}, + { "#url" : "https://mangadex.org/titles/feed", "#class" : mangadex.MangadexFeedExtractor,