[deviantart] improve 'index' extraction for stash files (#5335)

This commit is contained in:
Mike Fährmann
2024-03-22 02:53:54 +01:00
parent 1d6260f456
commit a650fd3177

View File

@@ -213,7 +213,9 @@ class DeviantartExtractor(Extractor):
"""Adjust the contents of a Deviation-object"""
if "index" not in deviation:
try:
if deviation["url"].startswith("https://sta.sh"):
if deviation["url"].startswith((
"https://www.deviantart.com/stash/", "https://sta.sh",
)):
filename = deviation["content"]["src"].split("/")[5]
deviation["index_base36"] = filename.partition("-")[0][1:]
deviation["index"] = id_from_base36(