[furaffinity] add 'artist_url' metadata field (closes #821)
This commit is contained in:
@@ -48,6 +48,7 @@ class FuraffinityExtractor(Extractor):
|
|||||||
extr = text.extract_from(self.request(url).text)
|
extr = text.extract_from(self.request(url).text)
|
||||||
title, _, artist = text.unescape(extr(
|
title, _, artist = text.unescape(extr(
|
||||||
'property="og:title" content="', '"')).rpartition(" by ")
|
'property="og:title" content="', '"')).rpartition(" by ")
|
||||||
|
artist_url = artist.replace("_", "").lower()
|
||||||
path = extr('href="//d.facdn.net/', '"')
|
path = extr('href="//d.facdn.net/', '"')
|
||||||
|
|
||||||
if not path:
|
if not path:
|
||||||
@@ -64,11 +65,12 @@ class FuraffinityExtractor(Extractor):
|
|||||||
rh = text.remove_html
|
rh = text.remove_html
|
||||||
|
|
||||||
data = text.nameext_from_url(path, {
|
data = text.nameext_from_url(path, {
|
||||||
"id" : pi(post_id),
|
"id" : pi(post_id),
|
||||||
"title" : title,
|
"title" : title,
|
||||||
"artist": artist,
|
"artist" : artist,
|
||||||
"user" : self.user or artist,
|
"artist_url": artist_url,
|
||||||
"url" : "https://d.facdn.net/" + path
|
"user" : self.user or artist_url,
|
||||||
|
"url" : "https://d.facdn.net/" + path
|
||||||
})
|
})
|
||||||
|
|
||||||
tags = extr('class="tags-row">', '</section>')
|
tags = extr('class="tags-row">', '</section>')
|
||||||
@@ -178,6 +180,7 @@ class FuraffinityPostExtractor(FuraffinityExtractor):
|
|||||||
"url": "eae4ef93d99365c69b31a37561bd800c03d336ad",
|
"url": "eae4ef93d99365c69b31a37561bd800c03d336ad",
|
||||||
"keyword": {
|
"keyword": {
|
||||||
"artist" : "mirlinthloth",
|
"artist" : "mirlinthloth",
|
||||||
|
"artist_url" : "mirlinthloth",
|
||||||
"date" : "dt:2016-11-27 17:24:06",
|
"date" : "dt:2016-11-27 17:24:06",
|
||||||
"description": "A Song made playing the game Cosmic DJ.",
|
"description": "A Song made playing the game Cosmic DJ.",
|
||||||
"extension" : "mp3",
|
"extension" : "mp3",
|
||||||
|
|||||||
Reference in New Issue
Block a user