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

[Feature] Overwrite ugoira #1112

Closed
3 tasks done
Toyem opened this issue Apr 3, 2022 · 7 comments
Closed
3 tasks done

[Feature] Overwrite ugoira #1112

Toyem opened this issue Apr 3, 2022 · 7 comments

Comments

@Toyem
Copy link
Contributor

Toyem commented Apr 3, 2022

Prerequisites

Description

New feature proposed by @cglmrfreeman
Add a reprocess function to scan all the ugoira manga types and overwrite the old/bad files.

Actual behavior

This new feature work pretty much like the overwrite one present in the config.ini file only this one is targeted at ugoira.

If the option overwriteUgoira is True in the config.ini file, it overwrites old ugoira that are trying to be download and present in the database db.sqlte (basically ugoira already download).
However, it doesn't overwrite them is the option checkLastModified or skipUnknownSize is set to True (same behaviour as the overwrite option).

It's a more specific approach of the overwrite option aiming to replace more efficiently ugoira that might be corrupted as noticed in the issue #1109.

Disclaimer

It doesn't scan ALL the ugoira of the database, but when an ugoira already download is trying to be re-download it can overwrite it.

Improvement

To archive the exact behaviour as stated in the description, a way to do it would be to be able to export the whole database as a txt file and re-download it using the option 4. Download from list of the main menu.

Versions

PixivDownloader2 version 20220311-beta3

@Toyem
Copy link
Contributor Author

Toyem commented Apr 3, 2022

I leave the issue open for some time if you have possible improvements to propose
So I'm not going to make a pull request right away

@biggestsonicfan
Copy link
Contributor

I wouldn't mind a u option under Others for an en-mass ugoira re-encode. Better versions of ffmpeg come out, and I actually have quite a bit of corrupt webm files, some from artists who probably don't exist on Pixiv anymore.

@Toyem
Copy link
Contributor Author

Toyem commented Apr 6, 2022

If the feature to re-encode en-mass ugoira is made, is it really useful to keep the option describe in the issue (the overwriteUgoira) ? Cause i feel like it's redondante and not really relevant if a re-encode option is available.
Should i delete it and only keep the re-encode one ?

Nandaka pushed a commit that referenced this issue Apr 13, 2022
* Develops the issue #1112
Create an option overwriteUgoira in config.ini that behave like the overwrite option but is targeted toward ugoira.
Option created to overcome the bug raised by the issue #1109
Prone to improvement

* New export by post_id feature
Add feature in menu to export all Pixiv, Fanbox and Sketch post ever download in a txt file
Feature following possible improvement of issue #1112
Add feature in command line to export all Pixiv, Fanbox and Sketch post ever download in a txt file
Add info in readme

* Add feature asked by @cglmrfreeman in issue #1112
Overwrite all ugoira, gif, webp, webm, apng if the corresponding option are selected in config.ini
Re-encode based on the zip folder
Add feature to export whole database in a single command
Can export Fanbox, Skecth post_id and Pixiv image_id in a file txt
@PatrickL546
Copy link
Contributor

Nice! I had to quickly bash some code to re-encode my ugoira when the new settings were added. Saved me like 200gb's. Now other people don't have to go through what I did.

@Toyem
Copy link
Contributor Author

Toyem commented Apr 14, 2022

This might be of help to someone (https://github.com/PatrickL546/PixivUtil2-batch-downloader/blob/master/!Scripts/7%20Convert%20ugoira%20to%20webm.py) If you just downloaded that script, it has to be in the same folder as 'PixivUtil2'. Haven't added a way to choose an install folder because it's included. I have a script to encode .ugoria using pixivutil2. Doesn't have to be webM as it uses the config settings of pixivutil2. If you don't have .ugoira I think you can use pixivutil2 to make it with "createUgoira", True), you have to redownload it if the zip file is not present

The code that goes through files is actually pretty synthetic and quite good. I probably will improve the actual one with it cause rn, it can take a hell lot of time if you have a lot of zip files.

@Toyem
Copy link
Contributor Author

Toyem commented Apr 16, 2022

@PatrickL546 I didn't find it necessary to keep this option since all new ugoira downloaded are encoded by ffmepg without errors and there is now an option (u) to re-encode old ugoira based on the zip (because the zip always contains all the images, it's only the files like gif or webp that can be wrong).

Re-downloading ugoira with the overwriteUgoira option to re-encode them won't change anything (except consuming your bandwidth 😋 ) because as said before, the zip is perfectly clean and not buggy (regarding issue 1109).

@Toyem Toyem closed this as completed Apr 22, 2022
@Toyem
Copy link
Contributor Author

Toyem commented May 13, 2022

Sorry to reopen the issue, I just found out that there is a problem with the function i made. The gif is not reprocessed if the artwork doesn't exist on pixiv anymore.
It's mainly due to the fact that i choose to select "zip" as base of the reprocessing where using an "ugoira" would have been more logical.
Working on it ...

@Toyem Toyem reopened this May 13, 2022
Nandaka pushed a commit that referenced this issue May 15, 2022
* fix reencoding givingup, implement restore feature in case of failure during reencoding, fix rglob issue with reencoding (#1112)

* fix overwrite issue and backup of file (#1112)
@Toyem Toyem closed this as completed May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants