[hentaicosplays] support 'hentai-cosplay-xxx.com' (#5959)

This commit is contained in:
Mike Fährmann
2024-08-10 12:14:18 +02:00
parent 87a14a50e7
commit 8d1805e336
3 changed files with 20 additions and 6 deletions

View File

@@ -4,7 +4,7 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""Extractors for https://hentai-cosplays.com/
"""Extractors for https://hentai-cosplay-xxx.com/
(also works for hentai-img.com and porn-images-xxx.com)"""
from .common import GalleryExtractor
@@ -13,19 +13,21 @@ from .. import text
class HentaicosplaysGalleryExtractor(GalleryExtractor):
"""Extractor for image galleries from
hentai-cosplays.com, hentai-img.com, and porn-images-xxx.com"""
hentai-cosplay-xxx.com, hentai-img.com, and porn-images-xxx.com"""
category = "hentaicosplays"
directory_fmt = ("{site}", "{title}")
filename_fmt = "{filename}.{extension}"
archive_fmt = "{title}_{filename}"
pattern = r"((?:https?://)?(?:\w{2}\.)?" \
r"(hentai-cosplays|hentai-img|porn-images-xxx)\.com)/" \
r"(hentai-cosplay(?:s|-xxx)|hentai-img|porn-images-xxx)\.com)/" \
r"(?:image|story)/([\w-]+)"
example = "https://hentai-cosplays.com/image/TITLE/"
example = "https://hentai-cosplay-xxx.com/image/TITLE/"
def __init__(self, match):
root, self.site, self.slug = match.groups()
self.root = text.ensure_http_scheme(root)
if self.root == "https://hentai-cosplays.com":
self.root = "https://hentai-cosplay-xxx.com"
url = "{}/story/{}/".format(self.root, self.slug)
GalleryExtractor.__init__(self, match, url)