[tumblr] in case of exception use filename as 'hash' (#129)

While a filename might not be a real 'hash', or comparable to what
tumbler usually provides, it is still better than an empty string.
At least as long as "alternatives" in format strings aren't implemented.
This commit is contained in:
Mike Fährmann
2018-12-04 19:15:23 +01:00
parent 95636418ad
commit ad2cefda6b

View File

@@ -161,7 +161,8 @@ class TumblrExtractor(Extractor):
try:
post["hash"] = parts[1] if parts[1] != "inline" else parts[2]
except IndexError:
post["hash"] = ""
# filename doesn't follow the usual pattern (#129)
post["hash"] = post["name"]
return Message.Url, url, post