1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-23 03:02:50 +01:00

[hentai2read] fix and update keywords

Added the "author" keyword and changed the name of a few others to be
consistent with other manga/chapter extractors.
This commit is contained in:
Mike Fährmann 2017-08-22 13:51:00 +02:00
parent c45770331a
commit e61a3a56d1
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
4 changed files with 16 additions and 14 deletions

View File

@ -42,7 +42,7 @@ class Hentai2readChapterExtractor(hentaicdn.HentaicdnChapterExtractor):
pattern = [r"(?:https?://)?(?:www\.)?hentai2read\.com/([^/]+)/(\d+)"]
test = [("http://hentai2read.com/amazon_elixir/1/", {
"url": "964b942cf492b3a129d2fe2608abfc475bc99e71",
"keyword": "c05d0d0bbe188926b15a43df1f8f65b8ac11c3fd",
"keyword": "fc79e4c70d61ae476aea2b63a75324e3d96f4497",
})]
def __init__(self, match):
@ -54,13 +54,16 @@ class Hentai2readChapterExtractor(hentaicdn.HentaicdnChapterExtractor):
def get_job_metadata(self, page, images):
title = text.extract(page, "<title>", "</title>")[0]
match = re.match(r"Reading (?:(.+) dj - )?(.+) Hentai - \d+: ", title)
match = re.match(r"Reading (.+) \(([^)]+)\) Hentai(?: by (.+))? - "
r"(\d+): (.+) . Page 1 ", title)
return {
"gallery-id": images[0].split("/")[-3],
"manga-id": images[0].split("/")[-3],
"chapter": self.chapter,
"count": len(images),
"series": match.group(1) or "",
"title": match.group(2),
"manga": match.group(1),
"type": match.group(2),
"author": match.group(3),
"title": match.group(5),
"lang": "en",
"language": "English",
}

View File

@ -16,8 +16,8 @@ import json
class HentaicdnChapterExtractor(Extractor):
"""Base class for extractors for a single manga chapter"""
subcategory = "chapter"
directory_fmt = ["{category}", "{gallery-id} {title}"]
filename_fmt = ("{category}_{gallery-id}_{chapter:>02}_"
directory_fmt = ["{category}", "{manga-id} {title}"]
filename_fmt = ("{category}_{manga-id}_{chapter:>02}_"
"{num:>03}.{extension}")
url = ""
@ -27,8 +27,7 @@ class HentaicdnChapterExtractor(Extractor):
data = self.get_job_metadata(page, images)
yield Message.Version, 1
yield Message.Directory, data
for num, part in enumerate(images, 1):
data["num"] = num
for data["num"], part in enumerate(images, 1):
url = "https://hentaicdn.com/hentai" + part
yield Message.Url, url, text.nameext_from_url(url, data)

View File

@ -40,7 +40,7 @@ class HentaihereChapterExtractor(hentaicdn.HentaicdnChapterExtractor):
pattern = [r"(?:https?://)?(?:www\.)?hentaihere\.com/m/S(\d+)/(\d+)"]
test = [("https://hentaihere.com/m/S13812/1/1/", {
"url": "964b942cf492b3a129d2fe2608abfc475bc99e71",
"keyword": "e8625ccca8466a5dee089394fc29efea6d6e2950",
"keyword": "fd6e515ccf073e3b57d39c5cb472692858bddb88",
})]
def __init__(self, match):
@ -55,11 +55,11 @@ class HentaihereChapterExtractor(hentaicdn.HentaicdnChapterExtractor):
pattern = r"Page 1 \| (.+) \(([^)]+)\) - Chapter \d+: (.+) by (.+) at "
match = re.match(pattern, title)
return {
"gallery-id": self.gid,
"title": match.group(1),
"manga-id": self.gid,
"manga": match.group(1),
"type": match.group(2),
"chapter": self.chapter,
"chapter-name": match.group(3),
"title": match.group(3),
"author": match.group(4),
"count": len(images),
"lang": "en",

View File

@ -267,7 +267,7 @@ class PixivRankingExtractor(PixivExtractor):
test = [
(("https://www.pixiv.net/ranking.php"
"?mode=daily&content=illust&date=20170818"), {
"url": "83a3809e52a58f39f5cf5878fa8fcd9d8df6c760",
"url": "7fdffbecfbd420b1d202fa417d79317240be30bc",
}),
("https://www.pixiv.net/ranking.php", None),
]