Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix re-encoding not ugoira zip files #1313

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PixivImageHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def process_ugoira_local(caller, config):
zip_name = os.path.splitext(os.path.basename(zip))[0]
zip_dir = os.path.dirname(zip)
image_id = zip_name.partition("_")[0]
if image_id not in list_done:
if 'ugoira' in zip_name and image_id not in list_done:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is assuming the zip file will always contains ugoira in the filename, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.
According to my observation, all ugoira downloaded are in format

{id}_ugoira{resolution} - {name}.zip

But file attached in fanbox usually do not contain "ugoira" in filename, such as

189281_p0_7RHGqTqoO0JzAJg23uGWPl9C - 過去絵-サイド高画質版-改.zip.

FIlter by "ugoira" should be a acceptable method.

counter += 1
PixivHelper.print_and_log(None, f"# Ugoira {counter}")
PixivHelper.print_and_log("info", "Deleting old animated files ...", newline=False)
Expand Down