From 91db8df1c79d52ffee24ef88762e8e6f6bd0a6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 7 Nov 2020 18:37:41 +0100 Subject: [PATCH] [deviantart] add 'index_base36' metadata field (closes #1099) This is the same ID as found in 'filename' without the 'd' in front, which is just 'index' encoded in base36. --- gallery_dl/extractor/deviantart.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index e40ec51f..456a173e 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -165,11 +165,12 @@ class DeviantartExtractor(Extractor): # filename metadata alphabet = "0123456789abcdefghijklmnopqrstuvwxyz" + deviation["index_base36"] = util.bencode(deviation["index"], alphabet) sub = re.compile(r"\W").sub deviation["filename"] = "".join(( sub("_", deviation["title"].lower()), "_by_", sub("_", deviation["author"]["username"].lower()), "-d", - util.bencode(deviation["index"], alphabet), + deviation["index_base36"], )) @staticmethod