From ad2cefda6bf68a9cb5a99bc6fc8a124d47d77c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 4 Dec 2018 19:15:23 +0100 Subject: [PATCH] [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. --- gallery_dl/extractor/tumblr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/tumblr.py b/gallery_dl/extractor/tumblr.py index b8772c19..508a6e1c 100644 --- a/gallery_dl/extractor/tumblr.py +++ b/gallery_dl/extractor/tumblr.py @@ -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