mikf / gallery-dl

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

[REQUEST] Kemono.party text download support #1278

Closed ghost closed 3 years ago

ghost commented 3 years ago

Recently, Kemono.party support was added to gallery-dl. However, I was wondering if it would be possible to add a config option to download text that goes along with posts. Sometimes, some posts are text only, with links, or an image post may have some text to go with it. I would like for a way to also get those, alongside the contents of the post (images, gifs, videos, etc). Is this at all doable?

mikf commented 3 years ago

It is possible, but you need to do some config file / post processor shenanigans to get it to work:

        "kemonoparty": {
            "directory": ["{category}", "{service}", "{user}", "{id} {title}"],
            "filename": "{filename}.{extension}",
            "postprocessors": [
                {
                    "name": "metadata",
                    "event": "post",
                    "filename": "info.json"
                }
            ]
        }

This will create a separate directory for each post and write the entire metadata to a info.json file. If you want only the text content, use the following as post processor:

{
    "name": "metadata",
    "event": "post",
    "filename": "content.txt",
    "mode": "custom",
    "format": "{content}\n"
}
ghost commented 3 years ago

Just tried that. Works exactly how I was hoping. Thank you!