Skip to content

Commit

Permalink
[hentaicosplays] add 'slug' metadata field (closes #1483)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Apr 19, 2021
1 parent b4ed7cb commit cb86bb9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gallery_dl/extractor/hentaicosplays.py
Expand Up @@ -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/", {
Expand All @@ -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,
}

Expand Down

0 comments on commit cb86bb9

Please sign in to comment.