[newgrounds] prevent archive ID overlap (#3681)

add an 'i' and 'a' prefix to image and audio files
(/art/view/, /audio/listen/)
since their numeric ID may conflict with movies and other media
pull/3740/head
Mike Fährmann 2 years ago
parent 8148c2a097
commit c9a7345228
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -19,7 +19,7 @@ class NewgroundsExtractor(Extractor):
category = "newgrounds"
directory_fmt = ("{category}", "{artist[:10]:J, }")
filename_fmt = "{category}_{_index}_{title}.{extension}"
archive_fmt = "{_index}"
archive_fmt = "{_type}{_index}"
root = "https://www.newgrounds.com"
cookiedomain = ".newgrounds.com"
cookienames = ("NG_GG_username", "vmk1du5I8m")
@ -156,6 +156,7 @@ class NewgroundsExtractor(Extractor):
"title" : text.unescape(extr('"og:title" content="', '"')),
"description": text.unescape(extr(':description" content="', '"')),
"type" : extr('og:type" content="', '"'),
"_type" : "i",
"date" : text.parse_datetime(extr(
'itemprop="datePublished" content="', '"')),
"rating" : extr('class="rated-', '"'),
@ -175,6 +176,7 @@ class NewgroundsExtractor(Extractor):
"title" : text.unescape(extr('"og:title" content="', '"')),
"description": text.unescape(extr(':description" content="', '"')),
"type" : extr('og:type" content="', '"'),
"_type" : "a",
"date" : text.parse_datetime(extr(
'itemprop="datePublished" content="', '"')),
"url" : extr('{"url":"', '"').replace("\\/", "/"),
@ -227,6 +229,7 @@ class NewgroundsExtractor(Extractor):
"url" : src,
"date" : date,
"type" : type,
"_type" : "",
"description": text.unescape(descr or extr(
'itemprop="description" content="', '"')),
"rating" : extr('class="rated-', '"'),

Loading…
Cancel
Save