[weebcentral] fix extracting wrong number of chapter pages (#6966)

When downloading multiple chapters at once, all chapters after the first
one would download only as many pages per chapter as the first one had,
due to reusing a cached/shared dict in the wrong way.
This commit is contained in:
Mike Fährmann
2025-02-10 16:00:13 +01:00
parent 587205bf68
commit be77465e1b
2 changed files with 24 additions and 7 deletions

View File

@@ -50,14 +50,16 @@ class WeebcentralChapterExtractor(WeebcentralBase, ChapterExtractor):
def metadata(self, page):
extr = text.extract_from(page)
manga_id = extr("'series_id': '", "'")
data = self._extract_manga_data(manga_id)
data["chapter_id"] = self.groups[1]
data["chapter_type"] = extr("'chapter_type': '", "'")
chapter_type = extr("'chapter_type': '", "'")
chapter, sep, minor = extr("'number': '", "'").partition(".")
data["chapter"] = text.parse_int(chapter)
data["chapter_minor"] = sep + minor
data = {
"chapter": text.parse_int(chapter),
"chapter_id": self.groups[1],
"chapter_type": chapter_type,
"chapter_minor": sep + minor,
}
data.update(self._extract_manga_data(manga_id))
return data