From 6b8e3003dfd93b4b6e6d28487133a3db85e04d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 3 Dec 2017 02:34:35 +0100 Subject: [PATCH] [hentai2read] ensure consistent extraction results --- gallery_dl/extractor/hentai2read.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/gallery_dl/extractor/hentai2read.py b/gallery_dl/extractor/hentai2read.py index 6c40f620..6c664d4a 100644 --- a/gallery_dl/extractor/hentai2read.py +++ b/gallery_dl/extractor/hentai2read.py @@ -38,16 +38,11 @@ class Hentai2readMangaExtractor(MangaExtractor): mtype, pos = text.extract( page, '[', ']', pos) manga_id = util.safe_int(text.extract(page, 'data-mid="', '"', pos)[0]) - page, pos = text.extract( - page, '\n') - pos = 0 - while True: - url, pos = text.extract(page, '
  • \n\s+]+data-cid="([^"]+)">' + r'\s+([^<]+)<', page): chapter, _, title = text.unescape(chapter).strip().partition(" - ") results.append((url, { "manga_id": manga_id, "manga": manga, "type": mtype, @@ -55,6 +50,7 @@ class Hentai2readMangaExtractor(MangaExtractor): "chapter": util.safe_int(chapter), "title": title, "lang": "en", "language": "English", })) + return results class Hentai2readChapterExtractor(hentaicdn.HentaicdnChapterExtractor):