From 02a4a67f6d5629ec278809e9eae2ae8bb0ee9dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 27 Aug 2018 20:58:45 +0200 Subject: [PATCH] [postprocessor:ugoira] support danbooru sources --- gallery_dl/postprocessor/ugoira.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gallery_dl/postprocessor/ugoira.py b/gallery_dl/postprocessor/ugoira.py index 25b49705..3913d0ac 100644 --- a/gallery_dl/postprocessor/ugoira.py +++ b/gallery_dl/postprocessor/ugoira.py @@ -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: