[newgrounds] add 'post_url' metadata field (#2328)

This commit is contained in:
Mike Fährmann
2022-02-23 00:00:23 +01:00
parent 59749555b1
commit cf58048bd4

View File

@@ -103,7 +103,7 @@ class NewgroundsExtractor(Extractor):
}
def extract_post(self, post_url):
url = post_url
if "/art/view/" in post_url:
extract_data = self._extract_image_data
elif "/audio/listen/" in post_url:
@@ -111,9 +111,9 @@ class NewgroundsExtractor(Extractor):
else:
extract_data = self._extract_media_data
if self.flash:
post_url += "/format/flash"
url += "/format/flash"
response = self.request(post_url, fatal=False)
response = self.request(url, fatal=False)
if response.status_code >= 400:
return {}
page = response.text
@@ -134,6 +134,7 @@ class NewgroundsExtractor(Extractor):
data["tags"].sort()
data["user"] = self.user or data["artist"][0]
data["post_url"] = post_url
return data
@staticmethod