mikf / gallery-dl

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

reddit, how to use --chapter-filter as filename? #5560

Closed wankio closed 6 months ago

wankio commented 6 months ago

Some post don't even have keywords for filename, only keywords for directory/--chapter-filter. Which leads to default filename instead desired filename.

https://pastebin.com/ncQjzuxT

Hrxn commented 6 months ago

Why do you want to use filename at all? It's only some kind of internal ID used by reddit, anyway.

You probably want title, right?

wankio commented 6 months ago

Why do you want to use filename at all? It's only some kind of internal ID used by reddit, anyway.

You probably want title, right?

something like this : "filename": "r_{subreddit} u_{author} {id}_{title[:100]}_{filename}.{extension}",

there are many submission only have metadata for directory when "parent-metadata": true,

as before, that parent-metadata usually use reddit as parent metadata, so if reddit have redgifs, imgur,etc.. it still use reddit metadata, but now i dont know why it won't work

*btw look like i'm forgot "category-transfer": true," error.

All i need is just copy metadata from reddit extractor and paste it directly into filename part of redgifs, imgur, problem will be solved

Hrxn commented 6 months ago

@wankio

Just make sure that you have these options for "reddit":


"reddit":
{
            "parent-directory": true,
            "parent-metadata": "_reddit_",
}

Then you can re-use the metadata coming from reddit for stuff hosted on redgifs like this:

        "reddit>redgifs":
        {
            "filename": "{_reddit_[date]:%Y-%m-%d}.{_reddit_[title][:180]!t:?/./R.//}{_reddit_[author]!t:?/./R.//}Score={_reddit_[score]}.Comments={_reddit_[num_comments]}.{_reddit_[id]}{num:?.//>04}.{userName:?/./}{filename}.{extension}"
        },

Just put that "reddit>redgifs" block below your "reddit" block, for example. Although it doesn't really matter. Must be in "extractor", though.