From 14d77aaab2fcb632832afcdcd37de0bb22158026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Fri, 1 Apr 2016 14:01:45 +0200 Subject: [PATCH] Read /etc/youtube-dl.ini config file --- youtube_dl/options.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/youtube_dl/options.py b/youtube_dl/options.py index 0d7340b4e..8c2a37214 100644 --- a/youtube_dl/options.py +++ b/youtube_dl/options.py @@ -854,6 +854,9 @@ def parseOpts(overrideArguments=None): user_sections = {} else: system_conf = compat_conf(_readOptions('/etc/youtube-dl.conf')) + system_global, system_sections = _readIni('/etc/youtube-dl.ini') + system_conf.extend(system_global) + if '--ignore-config' in system_conf: user_conf = [] user_sections = {} @@ -865,6 +868,8 @@ def parseOpts(overrideArguments=None): opts, args = parser.parse_args(argv) if opts.verbose: write_string('[debug] System config: ' + repr(_hide_login_info(system_conf)) + '\n') + for section, section_args in system_sections.items(): + write_string('[debug] System config for "' + section + '": ' + repr(_hide_login_info(section_args)) + '\n') write_string('[debug] User config: ' + repr(_hide_login_info(user_conf)) + '\n') for section, section_args in user_sections.items(): write_string('[debug] User config for "' + section + '": ' + repr(_hide_login_info(section_args)) + '\n') @@ -873,6 +878,7 @@ def parseOpts(overrideArguments=None): def build_section_args(*sections): res = system_conf + user_conf for section in sections: + res.extend(system_sections.get(section, [])) res.extend(user_sections.get(section, [])) res.extend(command_line_conf) return res