[hentaifox] rename Chapter- to GalleryExtractor (#160)
This commit is contained in:
@@ -12,23 +12,24 @@ from .common import ChapterExtractor
|
|||||||
from .. import text
|
from .. import text
|
||||||
|
|
||||||
|
|
||||||
class HentaifoxChapterExtractor(ChapterExtractor):
|
class HentaifoxGalleryExtractor(ChapterExtractor):
|
||||||
"""Extractor for a single manga chapter from hentaifox.com"""
|
"""Extractor for image galleries from hentaifox.com"""
|
||||||
category = "hentaifox"
|
category = "hentaifox"
|
||||||
filename_fmt = "{category}_{chapter_id}_{page:>03}.{extension}"
|
subcategory = "gallery"
|
||||||
directory_fmt = ["{category}", "{chapter_id} {title}"]
|
filename_fmt = "{category}_{gallery_id}_{page:>03}.{extension}"
|
||||||
archive_fmt = "{chapter_id}_{page}"
|
directory_fmt = ["{category}", "{gallery_id} {title}"]
|
||||||
|
archive_fmt = "{gallery_id}_{page}"
|
||||||
pattern = [r"(?:https?://)?(?:www\.)?hentaifox\.com/gallery/(\d+)"]
|
pattern = [r"(?:https?://)?(?:www\.)?hentaifox\.com/gallery/(\d+)"]
|
||||||
test = [("https://hentaifox.com/gallery/56622/", {
|
test = [("https://hentaifox.com/gallery/56622/", {
|
||||||
"pattern": r"https://i\d*\.hentaifox\.com/\d+/\d+/\d+\.jpg",
|
"pattern": r"https://i\d*\.hentaifox\.com/\d+/\d+/\d+\.jpg",
|
||||||
"count": 24,
|
"count": 24,
|
||||||
"keyword": "a5cfc962e2b2c929942c357bd67f0cc32f834cec",
|
"keyword": "80fc0fb5db9626fffb078dd2e4f9aff4a9348686",
|
||||||
})]
|
})]
|
||||||
root = "https://hentaifox.com"
|
root = "https://hentaifox.com"
|
||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
self.chapter_id = match.group(1)
|
self.gallery_id = match.group(1)
|
||||||
url = "{}/gallery/{}".format(self.root, self.chapter_id)
|
url = "{}/gallery/{}".format(self.root, self.gallery_id)
|
||||||
ChapterExtractor.__init__(self, url)
|
ChapterExtractor.__init__(self, url)
|
||||||
|
|
||||||
def get_metadata(self, page):
|
def get_metadata(self, page):
|
||||||
@@ -44,11 +45,10 @@ class HentaifoxChapterExtractor(ChapterExtractor):
|
|||||||
|
|
||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
data[key] = text.remove_html(value).replace(" , ", ", ")
|
data[key] = text.remove_html(value).replace(" , ", ", ")
|
||||||
|
data["gallery_id"] = text.parse_int(self.gallery_id)
|
||||||
data["title"] = text.unescape(title)
|
data["title"] = text.unescape(title)
|
||||||
data["chapter_id"] = text.parse_int(self.chapter_id)
|
|
||||||
data["language"] = "English"
|
data["language"] = "English"
|
||||||
data["lang"] = "en"
|
data["lang"] = "en"
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def get_images(self, page):
|
def get_images(self, page):
|
||||||
|
|||||||
Reference in New Issue
Block a user