Skip to content

Commit

Permalink
[pp:ugoira] forward frame data as '_ugoira_frame_data' (#6154, #6285)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Oct 8, 2024
1 parent c0835a0 commit cc38042
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion gallery_dl/extractor/danbooru.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def items(self):

if post["extension"] == "zip":
if self.ugoira:
post["frames"] = self._ugoira_frames(post)
post["_ugoira_frame_data"] = post["frames"] = \
self._ugoira_frames(post)
post["_http_adjust_extension"] = False
else:
url = post["large_file_url"]
Expand Down
2 changes: 1 addition & 1 deletion gallery_dl/extractor/pixiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def _extract_files(self, work):
def _extract_ugoira(self, work):
ugoira = self.api.ugoira_metadata(work["id"])
url = ugoira["zip_urls"]["medium"]
work["frames"] = frames = ugoira["frames"]
work["_ugoira_frame_data"] = work["frames"] = frames = ugoira["frames"]
work["date_url"] = self._date_from_url(url)
work["_http_adjust_extension"] = False

Expand Down
4 changes: 2 additions & 2 deletions gallery_dl/postprocessor/ugoira.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ def __init__(self, job, options):
}, options)

def prepare(self, pathfmt):
if "frames" not in pathfmt.kwdict:
if "_ugoira_frame_data" not in pathfmt.kwdict:
self._frames = None
return

self._frames = pathfmt.kwdict["frames"]
self._frames = pathfmt.kwdict["_ugoira_frame_data"]
if pathfmt.extension == "zip":
self._convert_zip = True
if self.delete:
Expand Down

0 comments on commit cc38042

Please sign in to comment.