mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
12.03k stars 978 forks source link

`--ugoira-conv-lossless` keep zip or use local downloaded file if exists instead redownload it. #2777

Open gphg opened 2 years ago

gphg commented 2 years ago

My objectives: 1) keep the zip files locally for archival 2) produce encoded ugoira

mikf commented 2 years ago

Not possible with --ugoira-conv-lossless or any related command-line option. You'll have to use a post processor inside a config file and enable the keep-files option.

    "postprocessors": [
        {
            "name"          : "ugoira",
            "ffmpeg-args"   : ["-c:v", "libvpx-vp9", "-lossless", "1", "-pix_fmt", "yuv420p"],
            "ffmpeg-twopass": false,
            "whitelist"     : ["pixiv", "danbooru"],
            "keep-files"    : true
        }
    ]

The problem with that is that this will skip over any already existing .zip files and not convert them. --no-skip is a potential workaround, but that will re-download everything.

There is no good way of converting already downloaded ugoira archives, except maybe combining --no-skip, --filter, and disabling downloader.http.part, but no guarantees that this works without any issues:

--no-skip --filter "extension == 'zip'" -o downloader.http.part=false