From 06ff1d3a3cfc0d9b1d1e84b8faf66e74f3d3aadc Mon Sep 17 00:00:00 2001 From: bug-assassin <7788433+bug-assassin@users.noreply.github.com> Date: Tue, 26 Dec 2023 23:47:30 -0500 Subject: [PATCH] Replace text.extract with extr --- gallery_dl/extractor/bato.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gallery_dl/extractor/bato.py b/gallery_dl/extractor/bato.py index b82416d5..c885f27b 100644 --- a/gallery_dl/extractor/bato.py +++ b/gallery_dl/extractor/bato.py @@ -38,7 +38,7 @@ class BatoChapterExtractor(BatoBase, ChapterExtractor): ChapterExtractor.__init__(self, match, self.root + self.path) def metadata(self, page): - info, _ = text.extract( + info = text.extr( page, "", r" - Read Free Manga Online at Bato.To" ) info = info.encode('latin-1').decode('utf-8').replace("\n", "") @@ -83,13 +83,13 @@ class BatoMangaExtractor(BatoBase, MangaExtractor): def chapters(self, page): data = {} - num_chapters, _ = text.extract(page, ">Chapters<", "") - num_chapters, _ = text.extract(num_chapters, r"", r"") + num_chapters = text.extr(page, ">Chapters<", "") + num_chapters = text.extr(num_chapters, r"", r"") num_chapters = text.parse_int(num_chapters) if num_chapters == 0: raise exception.NotFoundError("chapter") - manga, _ = text.extract( + manga = text.extr( page, "", r" - Read Free Manga Online at Bato.To" ) manga = manga.encode('latin-1').decode('utf-8').replace("\n", "") @@ -97,7 +97,7 @@ class BatoMangaExtractor(BatoBase, MangaExtractor): results = [] for chapter_num in range(num_chapters): - chapter, _ = text.extract( + chapter = text.extr( page, f'
" ) chapter += r"" # so we can match the date @@ -105,15 +105,15 @@ class BatoMangaExtractor(BatoBase, MangaExtractor): chapter_no = re.search(r"-ch_([\d\.]+)", url).group(1) chapter_major, sep, chapter_minor = chapter_no.partition(".") - title, _ = text.extract( + title = text.extr( chapter, f'" ) - title, _ = text.extract(title, r"", r"") + title = text.extr(title, r"", r"") if title is None or title == "" or title == "": title, _ = text.extract(chapter, ">", "", pos) - date, _ = text.extract(chapter, "") - date, _ = text.extract(date, 'time="', '"') + date = text.extr(chapter, "") + date = text.extr(date, 'time="', '"') data["date"] = date data["title"] = title