mikf / gallery-dl

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

[Question] [Patreon] How to download only "content"(Just the post's text) #6312

Closed someonenameguy closed 1 week ago

someonenameguy commented 1 week ago

I'm trying to download the text "content" of every post on patreon.

I tried using:

"patreon": {
    "cookies": {"sess id here": "sess id here"},
    "files": ["content"]
    }

But is seem to still download the images. Then I tried

gallery-dl [URL] --filter "print(content)" >> text.txt

But some post contained more that one image so the text content is written multiple times.

Am I missing a option or config?

mikf commented 1 week ago

Use a metadata post processor to write metadata to disk:

        "patreon": {
            "cookies": {"sess id here": "sess id here"},
            "files": [],

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

gallery-dl [URL] --filter "print(content)" >> text.txt

--filter "num == 1 and print(content)" would print content for only the first file, but it would still ignore posts without files.

someonenameguy commented 1 week ago

Thanks! This works.

Use a metadata post processor to write metadata to disk:

        "patreon": {
            "cookies": {"sess id here": "sess id here"},
            "files": [],

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