[newgrounds] extract 'slug' metadata (#8064)

This commit is contained in:
Mike Fährmann
2025-08-17 17:13:26 +02:00
parent c71766e6ab
commit 7c10fce562
2 changed files with 18 additions and 0 deletions

View File

@@ -206,6 +206,7 @@ class NewgroundsExtractor(Extractor):
data["tags"].sort()
data["user"] = self.user or data["artist"][0]
data["slug"] = post_url[post_url.rfind("/")+1:]
data["post_url"] = post_url
return data

View File

@@ -25,6 +25,7 @@ __tests__ = (
"index" : 1993615,
"rating" : "e",
"score" : float,
"slug" : "ryu-is-hawt",
"tags" : [
"ryu",
"streetfighter",
@@ -40,6 +41,9 @@ __tests__ = (
"#category": ("", "newgrounds", "image"),
"#class" : newgrounds.NewgroundsImageExtractor,
"#results" : "https://art.ngfiles.com/images/1993000/1993615_4474_tomfulp_ryu-is-hawt.44f81090378ae9c257a5e46a8e17cc4d.gif?f1695674895",
"slug" : "ryu-is-hawt",
"title": "Ryu is Hawt",
},
{
@@ -51,6 +55,9 @@ __tests__ = (
"https://art.ngfiles.com/images/1438000/1438673_sailoryon_yon-dream-buster.jpg?f1601058173",
"https://art.ngfiles.com/comments/172000/iu_172374_7112211.jpg",
),
"slug" : "yon-dream-buster",
"title": "Yon Dream Buster!",
},
{
@@ -118,6 +125,16 @@ __tests__ = (
"#count" : 0,
},
{
"#url" : "https://www.newgrounds.com/art/view/shamfoo/arigatou-ke-xue-zhe69",
"#comment" : "japanese title, ascii slug (#8064)",
"#class" : newgrounds.NewgroundsImageExtractor,
"#results" : "https://art.ngfiles.com/images/878000/878868_shamfoo_arigatou-ke-xue-zhe69.png?f1555537672",
"slug" : "arigatou-ke-xue-zhe69",
"title": "ありがとう科学者69",
},
{
"#url" : "https://www.newgrounds.com/portal/view/595355",
"#comment" : "video",