[twibooru] fix posts without 'name' (fixes #2434)

This commit is contained in:
Mike Fährmann
2022-03-21 10:08:37 +01:00
parent 40ce505420
commit 42f2fd2ed7

View File

@@ -36,8 +36,9 @@ class TwibooruExtractor(BooruExtractor):
post["date"] = text.parse_datetime(
post["created_at"], "%Y-%m-%dT%H:%M:%S.%fZ")
name, sep, rest = post["name"].rpartition(".")
post["filename"] = name if sep else rest
if "name" in post:
name, sep, rest = post["name"].rpartition(".")
post["filename"] = name if sep else rest
class TwibooruPostExtractor(TwibooruExtractor):