From cefdde65bab411fb6e1f5c710173d6e2e7c30ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 24 Jul 2025 15:58:21 +0200 Subject: [PATCH] [readcomiconline] use 'text.re()' --- gallery_dl/extractor/readcomiconline.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/readcomiconline.py b/gallery_dl/extractor/readcomiconline.py index f6f6e91b..24a01712 100644 --- a/gallery_dl/extractor/readcomiconline.py +++ b/gallery_dl/extractor/readcomiconline.py @@ -11,7 +11,6 @@ from .common import Extractor, ChapterExtractor, MangaExtractor from .. import text, exception import binascii -import re BASE_PATTERN = r"(?i)(?:https?://)?(?:www\.)?readcomiconline\.(?:li|to)" @@ -65,7 +64,7 @@ class ReadcomiconlineIssueExtractor(ReadcomiconlineBase, ChapterExtractor): def metadata(self, page): comic, pos = text.extract(page, " - Read\r\n ", "\r\n") iinfo, pos = text.extract(page, " ", "\r\n", pos) - match = re.match(r"(?:Issue )?#(\d+)|(.+)", iinfo) + match = text.re(r"(?:Issue )?#(\d+)|(.+)").match(iinfo) return { "comic": comic, "issue": match[1] or match[2], @@ -81,8 +80,8 @@ class ReadcomiconlineIssueExtractor(ReadcomiconlineBase, ChapterExtractor): _ , pos = text.extract(page, "var pth = '", "", pos) var , pos = text.extract(page, "var ", "= '", pos) - replacements = re.findall( - r"l = l\.replace\(/([^/]+)/g, [\"']([^\"']*)", page) + replacements = text.re( + r"l = l\.replace\(/([^/]+)/g, [\"']([^\"']*)").findall(page) for path in page.split(var)[2:]: path = text.extr(path, "= '", "'")