[hentaicosplays] add 'slug' metadata field (closes #1483)
This commit is contained in:
@@ -28,7 +28,8 @@ class HentaicosplaysGalleryExtractor(GalleryExtractor):
|
|||||||
"keyword": {
|
"keyword": {
|
||||||
"count": 18,
|
"count": 18,
|
||||||
"site": "hentai-cosplays",
|
"site": "hentai-cosplays",
|
||||||
"title": str,
|
"slug": "---devilism--tide-kurihara-",
|
||||||
|
"title": "艦 こ れ-devilism の tide Kurihara 憂",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
("https://fr.porn-images-xxx.com/image/enako-enako-24/", {
|
("https://fr.porn-images-xxx.com/image/enako-enako-24/", {
|
||||||
@@ -52,15 +53,16 @@ class HentaicosplaysGalleryExtractor(GalleryExtractor):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
root, self.site, path = match.groups()
|
root, self.site, self.slug = match.groups()
|
||||||
self.root = text.ensure_http_scheme(root)
|
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)
|
GalleryExtractor.__init__(self, match, url)
|
||||||
|
|
||||||
def metadata(self, page):
|
def metadata(self, page):
|
||||||
title = text.extract(page, "<title>", "</title>")[0]
|
title = text.extract(page, "<title>", "</title>")[0]
|
||||||
return {
|
return {
|
||||||
"title": text.unescape(title.rpartition(" Story Viewer - ")[0]),
|
"title": text.unescape(title.rpartition(" Story Viewer - ")[0]),
|
||||||
|
"slug" : self.slug,
|
||||||
"site" : self.site,
|
"site" : self.site,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user