mikf / gallery-dl

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

Config file refuses to get used by gallery-dl #2705

Closed ghost closed 2 years ago

ghost commented 2 years ago

Gallery-dl doesn't seem to respect my config and I got no clue why.

I want to have it so that Gallery-dl downloads to the download's folder on my pc, and the config file should work with this, but Gallery-dl doesn't seem to recognize or use it.

Config File { "extractor": { "base-directory": "C:/Users/user/Downloads", "parent-directory": false, "postprocessors": null, "archive": null, "cookies": null, "cookies-update": true, "proxy": null, "skip": true, "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0", "retries": 4, "timeout": 30.0, "verify": true, "fallback": true, "sleep": 0, "sleep-request": 0, "sleep-extractor": 0, "path-restrict": "auto", "path-replace": "_", "path-remove": "\\u0000-\\u001f\\u007f", "path-strip": "auto", "extension-map": { "jpeg": "jpg", "jpe" : "jpg", "jfif": "jpg", "jif" : "jpg", "jfi" : "jpg" }, "Browser Import" { --cookies-from firefox }, "artstation": { "external": false }, "aryion": { "username": null, "password": null, "recursive": true }, "bbc": { "width": 1920 }, "blogger": { "videos": true }, "cyberdrop": { "domain": "auto" }, "danbooru": { "username": null, "password": null, "external": false, "metadata": false, "ugoira": false }, "derpibooru": { "api-key": null, "filter": 56027 }, "deviantart": { "client-id": null, "client-secret": null, "comments": false, "extra": false, "flat": true, "folders": false, "include": "gallery", "journals": "html", "mature": true, "metadata": false, "original": true, "wait-min": 0 }, "e621": { "username": null, "password": null }, "exhentai": { "username": null, "password": null, "domain": "auto", "limits": true, "metadata": false, "original": true, "sleep-request": 5.0 }, "flickr": { "videos": true, "size-max": null }, "furaffinity": { "descriptions": "text", "external": false, "include": "gallery", "layout": "auto" }, "gfycat": { "format": ["mp4", "webm", "mobile", "gif"] }, "hentaifoundry": { "include": "pictures" }, "hitomi": { "format": "webp", "metadata": false }, "idolcomplex": { "username": null, "password": null, "sleep-request": 5.0 }, "imgbb": { "username": null, "password": null }, "imgur": { "mp4": true }, "inkbunny": { "username": null, "password": null, "orderby": "create_datetime" }, "instagram": { "username": null, "password": null, "include": "posts", "sleep-request": 8.0, "videos": true }, "khinsider": { "format": "mp3" }, "luscious": { "gif": false }, "mangadex": { "api-server": "https://api.mangadex.org", "api-parameters": null, "lang": null, "ratings": ["safe", "suggestive", "erotica", "pornographic"] }, "mangoxo": { "username": null, "password": null }, "newgrounds": { "username": null, "password": null, "flash": true, "format": "original", "include": "art" }, "nijie": { "username": null, "password": null, "include": "illustration,doujin" }, "oauth": { "browser": true, "cache": true, "port": 6414 }, "pillowfort": { "external": false, "inline": true, "reblogs": false }, "pinterest": { "sections": true, "videos": true }, "pixiv": { "refresh-token": null, "include": "artworks", "tags": "japanese", "ugoira": true }, "reactor": { "gif": false, "sleep-request": 5.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 }, "redgifs": { "format": ["hd", "sd", "gif"] }, "sankakucomplex": { "embeds": false, "videos": true }, "sankaku": { "username": null, "password": null }, "smugmug": { "videos": true }, "seiga": { "username": null, "password": null }, "subscribestar": { "username": null, "password": null }, "tsumino": { "username": null, "password": null }, "tumblr": { "avatar": false, "external": false, "inline": true, "posts": "all", "reblogs": true }, "twitter": { "username": null, "password": null, "cards": false, "conversations": false, "pinned": false, "quoted": false, "replies": true, "retweets": false, "text-tweets": false, "twitpic": false, "users": "timeline", "videos": true }, "unsplash": { "format": "raw" }, "vsco": { "videos": true }, "wallhaven": { "api-key": null }, "weasyl": { "api-key": null, "metadata": false }, "weibo": { "retweets": true, "videos": true }, "ytdl": { "enabled": false, "format": null, "generic": true, "logging": true, "module": null, "raw-options": null }, "booru": { "tags": false, "notes": false } }, "downloader": { "filesize-min": null, "filesize-max": null, "mtime": true, "part": true, "part-directory": null, "progress": 3.0, "rate": null, "retries": 4, "timeout": 30.0, "verify": true, "http": { "adjust-extensions": true, "headers": null }, "ytdl": { "format": null, "forward-cookies": false, "logging": true, "module": null, "outtmpl": null, "raw-options": null } }, "output": { "mode": "auto", "progress": true, "shorten": true, "colors": { "success": "1;32", "skip" : "2" }, "skip": true, "log": "[{name}][{levelname}] {message}", "logfile": null, "unsupportedfile": null }, "netrc": false }

The config file is located in the exact location where the gallery-dl.exe is located. (in my case C:\Apps\Command Line Tools\Gallery DL)

The config file is named config.conf and i've also tried switching it to config.json, neither worked.

So, is this a bug? Or am i doing something wrong?

Fukitsu commented 2 years ago

On Windows gallery-dl looks for the config file in these directories:

%APPDATA%\gallery-dl\config.json
%USERPROFILE%\gallery-dl\config.json
%USERPROFILE%\gallery-dl.conf
ghost commented 2 years ago

Thanks, the config file get's recognized now, but there's a error inside which i'm not quite sure of how to fix.

After troubleshooting the config file for a bit i solved some issues.

However one keeps on returning and i got no clue why.

This is the error

[config][warning] Could not parse 'C:\Users\user\gallery-dl.conf': Expecting value: line 36 column 39 (char 944)

Config File { "extractor": { "base-directory": "C:/Users/Quinten/Downloads", "parent-directory": false, "postprocessors": null, "archive": null, "cookies": null, "cookies-update": true, "proxy": null, "skip": true, "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0", "retries": 4, "timeout": 30.0, "verify": true, "fallback": true, "sleep": 0, "sleep-request": 0, "sleep-extractor": 0, "path-restrict": "auto", "path-replace": "_", "path-remove": "\\u0000-\\u001f\\u007f", "path-strip": "auto", "extension-map": { "jpeg": "jpg", "jpe" : "jpg", "jfif": "jpg", "jif" : "jpg", "jfi" : "jpg" }, "Browser Import": { "--cookies-from-browser": firefox }, "artstation": { "external": false }, "aryion": { "username": null, "password": null, "recursive": true }, "bbc": { "width": 1920 }, "blogger": { "videos": true }, "cyberdrop": { "domain": "auto" }, "danbooru": { "username": null, "password": null, "external": false, "metadata": false, "ugoira": false }, "derpibooru": { "api-key": null, "filter": 56027 }, "deviantart": { "client-id": null, "client-secret": null, "comments": false, "extra": false, "flat": true, "folders": false, "include": "gallery", "journals": "html", "mature": true, "metadata": false, "original": true, "wait-min": 0 }, "e621": { "username": null, "password": null }, "exhentai": { "username": null, "password": null, "domain": "auto", "limits": true, "metadata": false, "original": true, "sleep-request": 5.0 }, "flickr": { "videos": true, "size-max": null }, "furaffinity": { "descriptions": "text", "external": false, "include": "gallery", "layout": "auto" }, "gfycat": { "format": ["mp4", "webm", "mobile", "gif"] }, "hentaifoundry": { "include": "pictures" }, "hitomi": { "format": "webp", "metadata": false }, "idolcomplex": { "username": null, "password": null, "sleep-request": 5.0 }, "imgbb": { "username": null, "password": null }, "imgur": { "mp4": true }, "inkbunny": { "username": null, "password": null, "orderby": "create_datetime" }, "instagram": { "username": null, "password": null, "include": "posts", "sleep-request": 8.0, "videos": true }, "khinsider": { "format": "mp3" }, "luscious": { "gif": false }, "mangadex": { "api-server": "https://api.mangadex.org", "api-parameters": null, "lang": null, "ratings": ["safe", "suggestive", "erotica", "pornographic"] }, "mangoxo": { "username": null, "password": null }, "newgrounds": { "username": null, "password": null, "flash": true, "format": "original", "include": "art" }, "nijie": { "username": null, "password": null, "include": "illustration,doujin" }, "oauth": { "browser": true, "cache": true, "port": 6414 }, "pillowfort": { "external": false, "inline": true, "reblogs": false }, "pinterest": { "sections": true, "videos": true }, "pixiv": { "refresh-token": null, "include": "artworks", "tags": "japanese", "ugoira": true }, "reactor": { "gif": false, "sleep-request": 5.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 }, "redgifs": { "format": ["hd", "sd", "gif"] }, "sankakucomplex": { "embeds": false, "videos": true }, "sankaku": { "username": null, "password": null }, "smugmug": { "videos": true }, "seiga": { "username": null, "password": null }, "subscribestar": { "username": null, "password": null }, "tsumino": { "username": null, "password": null }, "tumblr": { "avatar": false, "external": false, "inline": true, "posts": "all", "reblogs": true }, "twitter": { "username": null, "password": null, "cards": false, "conversations": false, "pinned": false, "quoted": false, "replies": true, "retweets": false, "text-tweets": false, "twitpic": false, "users": "timeline", "videos": true }, "unsplash": { "format": "raw" }, "vsco": { "videos": true }, "wallhaven": { "api-key": null }, "weasyl": { "api-key": null, "metadata": false }, "weibo": { "retweets": true, "videos": true }, "ytdl": { "enabled": false, "format": null, "generic": true, "logging": true, "module": null, "raw-options": null }, "booru": { "tags": false, "notes": false } }, "downloader": { "filesize-min": null, "filesize-max": null, "mtime": true, "part": true, "part-directory": null, "progress": 3.0, "rate": null, "retries": 4, "timeout": 30.0, "verify": true, "http": { "adjust-extensions": true, "headers": null }, "ytdl": { "format": null, "forward-cookies": false, "logging": true, "module": null, "outtmpl": null, "raw-options": null } }, "output": { "mode": "auto", "progress": true, "shorten": true, "colors": { "success": "1;32", "skip" : "2" }, "skip": true, "log": "[{name}][{levelname}] {message}", "logfile": null, "unsupportedfile": null }, "netrc": false }

The section of that code looks like this

, "Browser Import": { "--cookies-from-browser": firefox },

What can i do to solve this? because i got no clue on how to do it.

mikf commented 2 years ago

"Browser Import": { "--cookies-from-browser": firefox },

Change that entire block to just "cookies": ["firefox"], and put it next to "user-agent": ... etc

    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0",
    "cookies": ["firefox"],
    "retries": 4,

You cannot use command-line arguments inside a config file and "Browser Import" would also not get recognized. Not that it would cause any errors, but it wouldn't have any effect either.

nisehime commented 2 years ago

I have config named gallery-dl.conf in the same directory with an executable and it recognizes it without any commands.

ghost commented 2 years ago

Ah now it makes sense, good to know command line arguments don't work.

Thanks for helping me, the issue got solved.

a-washing-machine commented 2 years ago

You also can use the command line parameter _"--config=your_config_with_a_customname.conf" to set your own config file. In that case, it does check the same directory that gallery-dl.exe is in. This could be useful to you if you need to run commands with different config files for whatever reason. (I for one have multiple tumblr keys and cycle between different configs when downloading from there because of the "too many downloads in 1 hour" error tumblr can throw.)

Example: gallery-dl_1.22.4.exe -A=200 --config your_config_with_a_custom_name.conf USERNAME.tumblr.com >>outputFile.txt

(Oh and just to explain these: -A=200 -> Abort after 200 consecutive "already downloaded" files. >>outputFile.txt -> Outputs what was downloaded into a file instead of the command line.)