mikf / gallery-dl

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

[kemonoparty]how to down the content text to the txt files? #5472

Open maplestory03 opened 2 months ago

maplestory03 commented 2 months ago

some pantron or fanbox authors write some urls on it, how to get the content text? It can be found on gallery-dl -K URL(gallery-dl -K https://kemono.su/fanbox/user/xxxx/post/xxxx

Hrxn commented 2 months ago

With a "metadata" post-processor? Have you tried this?

maplestory03 commented 2 months ago

With a "metadata" post-processor? Have you tried this?

This method is indeed possible, but there is too much useless content, and each work has its own JSON. There are too many files, so I hope to separately extract the content from the content and add it in a file. I want to save text for each work in the same file (append, do not overwrite) For example, author fanbox_id's works 1 and 2 are all written in fanbox_id.txt

mikf commented 2 months ago

This can all be done with metadata post processor options.

For example

    "postprocessors": [
        {
            "name": "metadata",
            "event": "post",
            "format": "{content}",
            "filename": "{id}.txt"
        }
    ]
maplestory03 commented 2 months ago
"postprocessors": [
    {
        "name": "metadata",
        "event": "post",
        "format": "{content}",
        "filename": "{id}.txt"
    }
]

1、can it write to a {userid}.txt , author's all work in one dir? Different works are written in one txt file. write the latest at the beginning, append write, do not overwrite OR put them in one dir "name": "metadata", "event": "post", "format": "{content}", "filename": "{user}/{id}.txt" 2、this way only the text named user_id.txt not in the user's dir 3、If I need keywords other than content, such as date, published, and tags, how do I change the format

Hrxn commented 2 months ago

Own directory: Add metadata.directory, like this:

    "postprocessors": [
        {
            "name": "metadata",
            "event": "post",
            "format": "{content}",
            "filename": "{id}.txt",
            "directory": "{user}"
        }
    ]

You can also change the file open mode, this way gallery-dl will not create new files, you can append to already existing files:

    "postprocessors": [
        {
            "name": "metadata",
            "event": "post",
            "open": "a",
            "format": "{content}",
            "filename": "{id}.txt",
            "directory": "{user}"
        }
    ]

If I need keywords other than content, such as date, published, and tags, how do I change the format


"postprocessors": [
{
"name": "metadata",
"event": "post",
        "filename": "{id}.txt",
        "directory": "{user}",

        "mode": "custom",
        "content-format": ["{date}", "{tags:J, /}"]
    }
]


[`content.format`](https://gdl-org.github.io/docs/configuration.html#metadata-content-format)
mikf commented 2 months ago

            "directory": "{user}"

metadata.directory does not support format string replacement fields.

maplestory03 commented 2 months ago

This can all be done with metadata post processor options.

If the content contains hyperlinks, can I get the URL?