1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2025-02-01 03:51:42 +01:00

[hentaicosplays] add 'slug' metadata field (closes #1483)

This commit is contained in:
Mike Fährmann 2021-04-19 16:28:01 +02:00
parent b4ed7cb961
commit cb86bb9cc9
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -28,7 +28,8 @@ class HentaicosplaysGalleryExtractor(GalleryExtractor):
"keyword": {
"count": 18,
"site": "hentai-cosplays",
"title": str,
"slug": "---devilism--tide-kurihara-",
"title": "艦 こ れ-devilism の tide Kurihara 憂",
},
}),
("https://fr.porn-images-xxx.com/image/enako-enako-24/", {
@ -52,15 +53,16 @@ class HentaicosplaysGalleryExtractor(GalleryExtractor):
)
def __init__(self, match):
root, self.site, path = match.groups()
root, self.site, self.slug = match.groups()
self.root = text.ensure_http_scheme(root)
url = "{}/story/{}/".format(self.root, path)
url = "{}/story/{}/".format(self.root, self.slug)
GalleryExtractor.__init__(self, match, url)
def metadata(self, page):
title = text.extract(page, "<title>", "</title>")[0]
return {
"title": text.unescape(title.rpartition(" Story Viewer - ")[0]),
"slug" : self.slug,
"site" : self.site,
}