[comick] handle redirects

This commit is contained in:
Mike Fährmann
2025-09-07 09:11:30 +02:00
parent 69f4036e29
commit 2ebf1ad19c
2 changed files with 26 additions and 2 deletions

View File

@@ -67,9 +67,19 @@ class ComickChapterExtractor(ComickBase, ChapterExtractor):
def metadata(self, page):
slug, chstr = self.groups
manga = _manga_info(self, slug)
props = _chapter_info(self, manga, chstr)
ch = props["chapter"]
while True:
props = _chapter_info(self, manga, chstr)
if "__N_REDIRECT" in props:
path = props["__N_REDIRECT"]
self.log.debug("Following redirect to %s", path)
_, slug, chstr = path.rsplit("/", 2)
continue
ch = props["chapter"]
break
self._images = ch["md_images"]
if chapter := ch["chap"]: