Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to stop redownloading txt files on kemono.party #3202

Closed
scor2 opened this issue Nov 12, 2022 · 8 comments
Closed

[Question] How to stop redownloading txt files on kemono.party #3202

scor2 opened this issue Nov 12, 2022 · 8 comments

Comments

@scor2
Copy link

scor2 commented Nov 12, 2022

    "kemonoparty":
    {
        "metadata": true,
        "directory":  ["{category}", "{service}", "{username}-{user}"],
        "archive": "M:/archive.sqlite3",
        "filename": "{id}_{title}_{num:>02}.{extension}",
        "postprocessors": [
            {
                "name": "metadata",
                "event": "post",
                "filename": "{id}.txt",
                "mode": "custom",
                "format": "{content}\n{embed}\n"
            }]
    },

When I set the config as above
The previously downloaded image file won't re-downloaded as I intended.

However, the metadata(post) txt files are redownloading? modifying? every time when I downloading.

Is it possible to avoid redownloading an already created metadata(post) txt file?

@AlttiRi
Copy link

AlttiRi commented Nov 13, 2022

#2421

@AlttiRi
Copy link

AlttiRi commented Nov 13, 2022

You need to define archive-format and archive in a postprocessor settings.

For example, Twitter:

        "twitter":
        {
            "retweets": false,
            "directory": ["[gallery-dl]", "[{category}] {author[name]}"],
            "filename": "[{category}] {author[name]}—{date:%Y.%m.%d}—{retweet_id|tweet_id}—{filename}.{extension}",
            "size": ["orig", "4096x4096", "large", "medium", "small"],
            "fallback": false,
            "cards": false,
            "pinned": true,
            "replies": "self",
            "cookies": {
                "auth_token": "XXX"
            },
            "text-tweets": false,
            "postprocessors": [{
                "name": "mtime",
                "event": "post"
            }, {
                "directory": "metadata",
                "filename": "[{category}] {author[name]}—{date:%Y.%m.%d}—{retweet_id|tweet_id}.html",
                "name": "metadata",
                "event": "post",
                "mtime": true,
                "mode": "custom",
                "archive": "~/gallery-dl/gallery-dl-postprocessors.sqlite",
                "archive-format": "{tweet_id}_{retweet_id}_p1",
                "format": "<div id='{retweet_id|tweet_id}'><h4><a href='https://twitter.com/{author[name]}/status/{retweet_id|tweet_id}'>{retweet_id|tweet_id}</a> by <a href='https://twitter.com/{author[name]}'>{author[name]}</a></h4><div class='content'>{content}</div><hr><div>{date:%Y.%m.%d %H:%M:%S}</div><hr></div><br>"
            }]
        },

@scor2
Copy link
Author

scor2 commented Nov 13, 2022

@AlttiRi
Looks like it working :)
Thank you for your help!

@bluerthanever
Copy link

Thanks for the answer.
But what if I don't want to keep a sqlite db for metadata, could gallery-dl just skip if the file exists?

@mikf
Copy link
Owner

mikf commented Nov 15, 2022

No, the only way to not overwrite an existing metadata file is with an archive.

@bluerthanever
Copy link

Okay, got it. Thanks!

@AlttiRi
Copy link

AlttiRi commented Nov 15, 2022

I recommend to use "mtime": true, in your metadata postprocessor with the additional mtime postprocessor:

{
    "name": "mtime"
}

like it's in my example above.

Even while the files will be overwrote, the metadata file's mtime will be the same each time.

@bluerthanever
Copy link

@AlttiRi Got it. Thank you very much.
The tool is just too powerful sometime that it's overwhelming for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants