mikf / gallery-dl

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

Converting Pixiv ugoira to gif, and changing filename and directory while also preserving the zip file #5744

Closed Fezzanyi closed 1 week ago

Fezzanyi commented 1 week ago

Hi. I am fairly new to all of this, so excuse me my lack of knowledge.

Some times ago I found those lines from #2101 and #2326, and so I tried to combine them in the config.json file. But even thought they work perfectly separately, they don't work when I tried to use them both, no mater in what ways I tried. I also wondered is it possible to convert this .zip to .gif while also, preserving both of them without deleting .zip file.

I would really appreciate it if someone would help me with this and possibly explained what the hell am I suppose to do. Cuz I have no idea.

The codes I am trying to combine: from #2101

{
    "extractor": {
        "pixiv": {
            "ugoira": true,
            "postprocessors": ["ugoira-gif"]
        }
    },

    "postprocessor": {
        "ugoira-gif": {
            "name": "ugoira",
            "extension": "gif",
            "ffmpeg-args": ["-filter_complex", "[0:v] split [a][b];[a] palettegen [p];[b][p] paletteuse"]
        }
    }
}

and from #2326

{
    "extractor":
    {
        "base-directory": "./",
        "twitter":
        {
            "retweets": "original",
            "videos": true,
            "directory": ["[gallery-dl]", "[{category}] {author[name]}"],
            "filename": "[{category}] {author[name]}—{date:%Y.%m.%d}—{retweet_id|tweet_id}—{filename}.{extension}"
        },
        "pixiv":
        {
            "directory": ["[gallery-dl]", "[{category}] {user[id]}—{user[name]}"],
            "filename": "[{category}] {user[id]}—{id}—{user[name]}—{date:%Y.%m.%d}—{title}—{num}.{extension}"
        }
    }
}
mikf commented 1 week ago

I would really appreciate it if someone would help me with this and possibly explained what the hell am I suppose to do. Cuz I have no idea.

You copy settings from both configs and combine them into the relevant sections of one, i.e. all from both pixiv sections into one, etc.

I also wondered is it possible to convert this .zip to .gif while also, preserving both of them without deleting .zip file.

Enable keep-files

{
    "extractor": {
        "base-directory": "./",
        "twitter":
        {
            "retweets": "original",
            "videos": true,
            "directory": ["[gallery-dl]", "[{category}] {author[name]}"],
            "filename": "[{category}] {author[name]}—{date:%Y.%m.%d}—{retweet_id|tweet_id}—{filename}.{extension}"
        },
        "pixiv": {
            "ugoira": true,
            "postprocessors": ["ugoira-gif"],
            "directory": ["[gallery-dl]", "[{category}] {user[id]}—{user[name]}"],
            "filename": "[{category}] {user[id]}—{id}—{user[name]}—{date:%Y.%m.%d}—{title}—{num}.{extension}"
        }
    },

    "postprocessor": {
        "ugoira-gif": {
            "name": "ugoira",
            "extension": "gif",
            "keep-files": true,
            "ffmpeg-args": ["-filter_complex", "[0:v] split [a][b];[a] palettegen [p];[b][p] paletteuse"]
        }
    }
}
Fezzanyi commented 1 week ago

Ohh... Many thanks, mate.