diff --git a/README.md b/README.md index e986ee010..93aa08c58 100644 --- a/README.md +++ b/README.md @@ -431,12 +431,12 @@ You can use `--ignore-config` if you want to disable the configuration file for In addition to globally setting options, you can also set different options for each extractor. A different set of files is used: `~/.config/youtube-dl/config.ini` and `/etc/youtube-dl.ini` on Unix, `%APPDATA%\youtube-dl\config.ini` or `C:\Users\\youtube-dl.ini` on Windows. -The files are stored in the [INI format](https://en.wikipedia.org/wiki/INI_file), each argument must be written in its own line using its full name without the leading `--`. +The files are stored in the [INI format](https://en.wikipedia.org/wiki/INI_file), each argument must be written in its own line using its full name without the leading `--` or the short version without the leading `-`. To start a section with the options for an specific extractor you can write a line in the form `[]`, where `` is the name printed before the info message while downloading (like `youtube`, `youtube:playlist`, `vimeo` ...). For example, with the following configuration file youtube-dl will always extract the audio, as an mp3 file for YouTube videos and if the are inside a playlist they will be saved in a different folder: ``` -extract-audio= +x= [youtube] audio-format=mp3 diff --git a/youtube_dl/options.py b/youtube_dl/options.py index 8c2a37214..a97fc7ae4 100644 --- a/youtube_dl/options.py +++ b/youtube_dl/options.py @@ -756,7 +756,7 @@ def parseOpts(overrideArguments=None): def convert_opts(opts): return [ - '--' + opt + ('' if not arg else ('=' + arg)) + ('-' if len(opt) == 1 else '--') + opt + ('' if not arg else ('=' + arg)) for opt, arg in opts] global_opts = convert_opts(parser.items('@GLOBAL@')) section_opts = dict((section, convert_opts(parser.items(section))) for section in parser.sections() if section != '@GLOBAL@')