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

[Question / How To] - Reddit Extractor/User/SubReddit/Filename #1612

Closed ondrovic closed 3 years ago

ondrovic commented 3 years ago

Looked at the extractors but couldn't figure out how to make this work but I am using a config.json which I include but how can you make it when Images download it downloads like the following

[extractor]/[user]/[subreddit]/[file] currently it defaults to [extrator]/[subreddit]/[file]

here is my current config.json file

{ "extractor": { "base-directory": "D:/Reddit/gallery", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0", "retries": 4, "timeout": 30.0, "verify": true, "sleep": 0, "sleep-request": 0, "sleep-extractor": 0, "reddit": { "comments": 0, "morecomments": false, "date-min": 0, "date-max": 253402210800, "date-format": "%Y-%m-%dT%H:%M:%S", "id-min": "0", "id-max": "zik0zj", "recursion": 0, "videos": true, "user-agent": "Python:gallery-dl:0.8.4 (by /u/mikf1)" }, "redgifs": { "format": "mp4" }, "imgur": { "mp4": true } } }

Scripter17 commented 3 years ago

You can set extractor.reddit.directory to ["reddit", "{author}", "{subreddit}"]

gallery-dl -K [URL] gives you all the fstrings you can use and configuration.rst has all the config options

Worth mentioning you can also set extractor.reddit.filename to something like "{author}-{subreddit}-{filename}.{extension}" to make searching through the directory easier

ondrovic commented 3 years ago

Thanks for the info