[newgrounds] extract 'type' metadata
This commit is contained in:
@@ -155,6 +155,7 @@ class NewgroundsExtractor(Extractor):
|
|||||||
data = {
|
data = {
|
||||||
"title" : text.unescape(extr('"og:title" content="', '"')),
|
"title" : text.unescape(extr('"og:title" content="', '"')),
|
||||||
"description": text.unescape(extr(':description" content="', '"')),
|
"description": text.unescape(extr(':description" content="', '"')),
|
||||||
|
"type" : extr('og:type" content="', '"'),
|
||||||
"date" : text.parse_datetime(extr(
|
"date" : text.parse_datetime(extr(
|
||||||
'itemprop="datePublished" content="', '"')),
|
'itemprop="datePublished" content="', '"')),
|
||||||
"rating" : extr('class="rated-', '"'),
|
"rating" : extr('class="rated-', '"'),
|
||||||
@@ -173,6 +174,7 @@ class NewgroundsExtractor(Extractor):
|
|||||||
return {
|
return {
|
||||||
"title" : text.unescape(extr('"og:title" content="', '"')),
|
"title" : text.unescape(extr('"og:title" content="', '"')),
|
||||||
"description": text.unescape(extr(':description" content="', '"')),
|
"description": text.unescape(extr(':description" content="', '"')),
|
||||||
|
"type" : extr('og:type" content="', '"'),
|
||||||
"date" : text.parse_datetime(extr(
|
"date" : text.parse_datetime(extr(
|
||||||
'itemprop="datePublished" content="', '"')),
|
'itemprop="datePublished" content="', '"')),
|
||||||
"url" : extr('{"url":"', '"').replace("\\/", "/"),
|
"url" : extr('{"url":"', '"').replace("\\/", "/"),
|
||||||
@@ -184,6 +186,7 @@ class NewgroundsExtractor(Extractor):
|
|||||||
def _extract_media_data(self, extr, url):
|
def _extract_media_data(self, extr, url):
|
||||||
index = url.split("/")[5]
|
index = url.split("/")[5]
|
||||||
title = extr('"og:title" content="', '"')
|
title = extr('"og:title" content="', '"')
|
||||||
|
type = extr('og:type" content="', '"')
|
||||||
descr = extr('"og:description" content="', '"')
|
descr = extr('"og:description" content="', '"')
|
||||||
src = extr('{"url":"', '"')
|
src = extr('{"url":"', '"')
|
||||||
|
|
||||||
@@ -223,6 +226,7 @@ class NewgroundsExtractor(Extractor):
|
|||||||
"title" : text.unescape(title),
|
"title" : text.unescape(title),
|
||||||
"url" : src,
|
"url" : src,
|
||||||
"date" : date,
|
"date" : date,
|
||||||
|
"type" : type,
|
||||||
"description": text.unescape(descr or extr(
|
"description": text.unescape(descr or extr(
|
||||||
'itemprop="description" content="', '"')),
|
'itemprop="description" content="', '"')),
|
||||||
"rating" : extr('class="rated-', '"'),
|
"rating" : extr('class="rated-', '"'),
|
||||||
@@ -305,6 +309,7 @@ class NewgroundsImageExtractor(NewgroundsExtractor):
|
|||||||
"score" : float,
|
"score" : float,
|
||||||
"tags" : ["ryu", "streetfighter"],
|
"tags" : ["ryu", "streetfighter"],
|
||||||
"title" : "Ryu is Hawt",
|
"title" : "Ryu is Hawt",
|
||||||
|
"type" : "article",
|
||||||
"user" : "tomfulp",
|
"user" : "tomfulp",
|
||||||
"width" : 447,
|
"width" : 447,
|
||||||
},
|
},
|
||||||
@@ -357,6 +362,7 @@ class NewgroundsMediaExtractor(NewgroundsExtractor):
|
|||||||
"score" : float,
|
"score" : float,
|
||||||
"tags" : ["alienhominid", "trailer"],
|
"tags" : ["alienhominid", "trailer"],
|
||||||
"title" : "Alien Hominid Fan Trailer",
|
"title" : "Alien Hominid Fan Trailer",
|
||||||
|
"type" : "movie",
|
||||||
"user" : "kickinthehead",
|
"user" : "kickinthehead",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@@ -373,6 +379,7 @@ class NewgroundsMediaExtractor(NewgroundsExtractor):
|
|||||||
"score" : float,
|
"score" : float,
|
||||||
"tags" : ["fulp", "interview", "tom", "zj"],
|
"tags" : ["fulp", "interview", "tom", "zj"],
|
||||||
"title" : "ZJ Interviews Tom Fulp!",
|
"title" : "ZJ Interviews Tom Fulp!",
|
||||||
|
"type" : "music.song",
|
||||||
"user" : "zj",
|
"user" : "zj",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@@ -380,6 +387,7 @@ class NewgroundsMediaExtractor(NewgroundsExtractor):
|
|||||||
("https://www.newgrounds.com/portal/view/161181/format/flash", {
|
("https://www.newgrounds.com/portal/view/161181/format/flash", {
|
||||||
"pattern": r"https://uploads\.ungrounded\.net/161000"
|
"pattern": r"https://uploads\.ungrounded\.net/161000"
|
||||||
r"/161181_ddautta_mask__550x281_\.swf\?f1081628129",
|
r"/161181_ddautta_mask__550x281_\.swf\?f1081628129",
|
||||||
|
"keyword": {"type": "movie"},
|
||||||
}),
|
}),
|
||||||
# format selection (#1729)
|
# format selection (#1729)
|
||||||
("https://www.newgrounds.com/portal/view/758545", {
|
("https://www.newgrounds.com/portal/view/758545", {
|
||||||
@@ -392,6 +400,49 @@ class NewgroundsMediaExtractor(NewgroundsExtractor):
|
|||||||
"options": (("username", None),),
|
"options": (("username", None),),
|
||||||
"count": 1,
|
"count": 1,
|
||||||
}),
|
}),
|
||||||
|
# flash game
|
||||||
|
("https://www.newgrounds.com/portal/view/829032", {
|
||||||
|
"pattern": r"https://uploads\.ungrounded\.net/829000"
|
||||||
|
r"/829032_picovsbeardx\.swf\?f1641968445",
|
||||||
|
"range": "1",
|
||||||
|
"keyword": {
|
||||||
|
"artist" : [
|
||||||
|
"dungeonation",
|
||||||
|
"carpetbakery",
|
||||||
|
"animalspeakandrews",
|
||||||
|
"bill",
|
||||||
|
"chipollo",
|
||||||
|
"dylz49",
|
||||||
|
"gappyshamp",
|
||||||
|
"pinktophat",
|
||||||
|
"rad",
|
||||||
|
"shapeshiftingblob",
|
||||||
|
"tomfulp",
|
||||||
|
"voicesbycorey",
|
||||||
|
"psychogoldfish",
|
||||||
|
],
|
||||||
|
"comment" : "re:The children are expendable. Take out the ",
|
||||||
|
"date" : "dt:2022-01-10 23:00:57",
|
||||||
|
"description": "Bloodshed in The Big House that Blew...again!",
|
||||||
|
"favorites" : int,
|
||||||
|
"index" : 829032,
|
||||||
|
"post_url" : "https://www.newgrounds.com/portal/view/829032",
|
||||||
|
"rating" : "m",
|
||||||
|
"score" : float,
|
||||||
|
"tags" : [
|
||||||
|
"assassin",
|
||||||
|
"boyfriend",
|
||||||
|
"darnell",
|
||||||
|
"nene",
|
||||||
|
"pico",
|
||||||
|
"picos-school",
|
||||||
|
],
|
||||||
|
"title" : "PICO VS BEAR DX",
|
||||||
|
"type" : "game",
|
||||||
|
"url" : "https://uploads.ungrounded.net/829000"
|
||||||
|
"/829032_picovsbeardx.swf?f1641968445",
|
||||||
|
},
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
|
|||||||
Reference in New Issue
Block a user