1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-26 04:32:51 +01:00

[postprocessor:ugoira] support danbooru sources

This commit is contained in:
Mike Fährmann 2018-08-27 20:58:45 +02:00
parent 5b8a314de7
commit 02a4a67f6d
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -34,11 +34,16 @@ class UgoiraPP(PostProcessor):
self.calculate_framerate = lambda _: (None, rate)
def run(self, pathfmt):
if (pathfmt.keywords["extension"] != "zip" or
"frames" not in pathfmt.keywords):
if pathfmt.keywords["extension"] != "zip":
return
if "frames" in pathfmt.keywords:
framelist = pathfmt.keywords["frames"]
elif "pixiv_ugoira_frame_data" in pathfmt.keywords:
framelist = pathfmt.keywords["pixiv_ugoira_frame_data"]["data"]
else:
return
framelist = pathfmt.keywords["frames"]
rate_in, rate_out = self.calculate_framerate(framelist)
with tempfile.TemporaryDirectory() as tempdir: