[weebdex] make metadata extraction non-fatal no2 (#8954)

9a102039fc
This commit is contained in:
Mike Fährmann
2026-01-28 19:48:38 +01:00
parent feef91bf09
commit a3f164aa50
2 changed files with 43 additions and 6 deletions

View File

@@ -49,14 +49,14 @@ class WeebdexChapterExtractor(WeebdexBase, ChapterExtractor):
return {
**_manga_info(self, rel["manga"]["id"]),
"title" : data.get("title", ""),
"version" : data["version"],
"volume" : text.parse_int(data["volume"]),
"version" : data.get("version", 0),
"volume" : text.parse_int(data.get("volume")),
"chapter" : text.parse_int(chapter),
"chapter_minor": sep + minor,
"chapter_id" : cid,
"date" : self.parse_datetime_iso(data["created_at"]),
"date_updated" : self.parse_datetime_iso(data["updated_at"]),
"lang" : data["language"],
"date" : self.parse_datetime_iso(data.get("created_at")),
"date_updated" : self.parse_datetime_iso(data.get("updated_at")),
"lang" : data.get("language"),
"uploader": rel["uploader"]["name"] if "uploader" in rel else "",
"group" : [g["name"] for g in rel.get("groups") or ()],
}
@@ -106,7 +106,7 @@ class WeebdexMangaExtractor(WeebdexBase, MangaExtractor):
for ch in data["data"]:
chapter, sep, minor = ch["chapter"].partition(".")
ch["volume"] = text.parse_int(ch["volume"])
ch["volume"] = text.parse_int(ch.get("volume"))
ch["chapter"] = text.parse_int(chapter)
ch["chapter_minor"] = sep + minor
ch.update(manga)

View File

@@ -130,6 +130,26 @@ ___
"year" : 2023,
},
{
"#url" : "https://weebdex.org/chapter/0fignihbv8",
"#comment" : "no 'volume' data",
"#class" : weebdex.WeebdexChapterExtractor,
"#count" : 47,
"artist" : ["Azuma Kiyohiko"],
"author" : ["Azuma Kiyohiko"],
"chapter" : 114,
"chapter_id" : "0fignihbv8",
"chapter_minor": "",
"count" : 47,
"date" : "dt:2025-10-17 23:36:27",
"demographic" : "shounen",
"group" : ["Ralen"],
"lang" : "en",
"manga" : "Yotsuba to!",
"volume" : 0,
},
{
"#url" : "https://weebdex.org/title/3o0icxno26/ani-datta-mono",
"#class" : weebdex.WeebdexMangaExtractor,
@@ -174,4 +194,21 @@ ___
],
},
{
"#url" : "https://weebdex.org/title/f29vfu3dd4/yotsuba-to",
"#comment" : "no 'volume' data (#8954)",
"#class" : weebdex.WeebdexMangaExtractor,
"#pattern" : weebdex.WeebdexChapterExtractor.pattern,
"artist" : ["Azuma Kiyohiko"],
"author" : ["Azuma Kiyohiko"],
"demographic": "shounen",
"manga" : "Yotsuba to!",
"manga_date" : "dt:2025-10-09 09:34:27",
"manga_id" : "f29vfu3dd4",
"origin" : "ja",
"volume" : int,
"year" : 2003,
},
)