diff options
| author | 2025-12-20 05:49:04 -0500 | |
|---|---|---|
| committer | 2025-12-20 05:49:04 -0500 | |
| commit | a24ec1647aeac35a63b744ea856011ad6e06be3b (patch) | |
| tree | ae94416de786aeddd05d99559098f7f16bb103a6 /gallery_dl/extractor/batoto.py | |
| parent | 33f8a8a37a9cba738ef25fb99955f0730da9eb48 (diff) | |
New upstream version 1.31.1.upstream/1.31.1
Diffstat (limited to 'gallery_dl/extractor/batoto.py')
| -rw-r--r-- | gallery_dl/extractor/batoto.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gallery_dl/extractor/batoto.py b/gallery_dl/extractor/batoto.py index a7d1b78..f8e803b 100644 --- a/gallery_dl/extractor/batoto.py +++ b/gallery_dl/extractor/batoto.py @@ -80,7 +80,7 @@ class BatotoBase(): class BatotoChapterExtractor(BatotoBase, ChapterExtractor): """Extractor for batoto manga chapters""" archive_fmt = "{chapter_id}_{page}" - pattern = BASE_PATTERN + r"/(?:title/[^/?#]+|chapter)/(\d+)" + pattern = rf"{BASE_PATTERN}/(?:title/[^/?#]+|chapter)/(\d+)" example = "https://xbato.org/title/12345-MANGA/54321" def __init__(self, match): @@ -104,7 +104,7 @@ class BatotoChapterExtractor(BatotoBase, ChapterExtractor): info = text.remove_html(extr('link-hover">', "</")) info = text.unescape(info) - match = util.re( + match = text.re( r"(?i)(?:(?:Volume|S(?:eason)?)\s*(\d+)\s+)?" r"(?:Chapter|Episode)\s*(\d+)([\w.]*)").match(info) if match: @@ -123,7 +123,7 @@ class BatotoChapterExtractor(BatotoBase, ChapterExtractor): "chapter_minor" : minor, "chapter_string": info, "chapter_id" : text.parse_int(self.chapter_id), - "date" : text.parse_timestamp(extr(' time="', '"')[:-3]), + "date" : self.parse_timestamp(extr(' time="', '"')[:-3]), } def images(self, page): @@ -139,8 +139,8 @@ class BatotoMangaExtractor(BatotoBase, MangaExtractor): """Extractor for batoto manga""" reverse = False chapterclass = BatotoChapterExtractor - pattern = (BASE_PATTERN + - r"/(?:title/(\d+)[^/?#]*|series/(\d+)(?:/[^/?#]*)?)/?$") + pattern = (rf"{BASE_PATTERN}" + rf"/(?:title/(\d+)[^/?#]*|series/(\d+)(?:/[^/?#]*)?)/?$") example = "https://xbato.org/title/12345-MANGA/" def __init__(self, match): @@ -167,8 +167,7 @@ class BatotoMangaExtractor(BatotoBase, MangaExtractor): data["chapter"] = text.parse_int(chapter) data["chapter_minor"] = sep + minor - data["date"] = text.parse_datetime( - extr('time="', '"'), "%Y-%m-%dT%H:%M:%S.%fZ") + data["date"] = self.parse_datetime_iso(extr('time="', '"')) url = f"{self.root}/title/{href}" results.append((url, data.copy())) @@ -188,9 +187,9 @@ def _manga_info(self, manga_id, page=None): "manga" : data["name"][1], "manga_id" : text.parse_int(manga_id), "manga_slug" : data["slug"][1], - "manga_date" : text.parse_timestamp( + "manga_date" : self.parse_timestamp( data["dateCreate"][1] // 1000), - "manga_date_updated": text.parse_timestamp( + "manga_date_updated": self.parse_timestamp( data["dateUpdate"][1] / 1000), "author" : json_list(data["authors"]), "artist" : json_list(data["artists"]), |
