mikf / gallery-dl

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

Single '{' encountered in format string #245

Closed ghost closed 5 years ago

ghost commented 5 years ago

when i use -o directory="{title}" in gallery-dl, i get the following error: Applying directory format string failed: ValueError: Single '{' encountered in format string

wankio commented 5 years ago

you may try -o base-directory=.\

mikf commented 5 years ago

-o "directory=['{title}']"

directory is expected to be a list of strings, but yours is only a single string. Iterating over a string in Python turns that string into single characters, so the first thing gallery-dl is seeing with "{title}" as input is a single "{".

ghost commented 5 years ago

Thank you both for the help !

ghost commented 5 years ago

nevermind i still get the error :/ here is the full command in case that help gallery-dl -o archive="./gallery-dl/idlist.cache" -o "directory=['{title}']" -d "%~dp0gallery-dl\doujinshi\English" https://nhentai.net/search/?q=splatoon+english

mikf commented 5 years ago

Ah sorry, I forgot JSON doesn't allow single quotes ... -o "directory=[\"{title}\"]"definitely works.

ghost commented 5 years ago

now it work perfectly, thanks for the quick response!