From c9a73452282f381d9651693f1a908ff6dca1ab7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 6 Mar 2023 15:03:49 +0100 Subject: [PATCH] [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 --- gallery_dl/extractor/newgrounds.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/newgrounds.py b/gallery_dl/extractor/newgrounds.py index 371e4005..2b759ec0 100644 --- a/gallery_dl/extractor/newgrounds.py +++ b/gallery_dl/extractor/newgrounds.py @@ -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-', '"'),