From 580947bfce18cc6ac4377b7c5ab795b41fa44d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 28 Jan 2019 21:49:26 +0100 Subject: [PATCH] [hentaifox] rename Chapter- to GalleryExtractor (#160) --- gallery_dl/extractor/hentaifox.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gallery_dl/extractor/hentaifox.py b/gallery_dl/extractor/hentaifox.py index 38def07317..d159e015ae 100644 --- a/gallery_dl/extractor/hentaifox.py +++ b/gallery_dl/extractor/hentaifox.py @@ -12,23 +12,24 @@ from .. import text -class HentaifoxChapterExtractor(ChapterExtractor): - """Extractor for a single manga chapter from hentaifox.com""" +class HentaifoxGalleryExtractor(ChapterExtractor): + """Extractor for image galleries from hentaifox.com""" category = "hentaifox" - filename_fmt = "{category}_{chapter_id}_{page:>03}.{extension}" - directory_fmt = ["{category}", "{chapter_id} {title}"] - archive_fmt = "{chapter_id}_{page}" + subcategory = "gallery" + filename_fmt = "{category}_{gallery_id}_{page:>03}.{extension}" + directory_fmt = ["{category}", "{gallery_id} {title}"] + archive_fmt = "{gallery_id}_{page}" pattern = [r"(?:https?://)?(?:www\.)?hentaifox\.com/gallery/(\d+)"] test = [("https://hentaifox.com/gallery/56622/", { "pattern": r"https://i\d*\.hentaifox\.com/\d+/\d+/\d+\.jpg", "count": 24, - "keyword": "a5cfc962e2b2c929942c357bd67f0cc32f834cec", + "keyword": "80fc0fb5db9626fffb078dd2e4f9aff4a9348686", })] root = "https://hentaifox.com" def __init__(self, match): - self.chapter_id = match.group(1) - url = "{}/gallery/{}".format(self.root, self.chapter_id) + self.gallery_id = match.group(1) + url = "{}/gallery/{}".format(self.root, self.gallery_id) ChapterExtractor.__init__(self, url) def get_metadata(self, page): @@ -44,11 +45,10 @@ def get_metadata(self, page): for key, value in data.items(): data[key] = text.remove_html(value).replace(" , ", ", ") + data["gallery_id"] = text.parse_int(self.gallery_id) data["title"] = text.unescape(title) - data["chapter_id"] = text.parse_int(self.chapter_id) data["language"] = "English" data["lang"] = "en" - return data def get_images(self, page):