X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=youtube_dl%2F__init__.py;h=807b735412a674bb4d2098a2a057c0e91266ad68;hb=bce878a7c1678ac698ecd556b2c77a1e2f2306df;hp=c4f64893d491f8e6f9927fd644b967cf0d9c3542;hpb=b9fc428494b22623529d364387b8693cc3cb1503;p=youtube-dl.git diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index c4f64893d..807b73541 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -126,7 +126,7 @@ def parseOpts(): general.add_option('-i', '--ignore-errors', action='store_true', dest='ignoreerrors', help='continue on download errors', default=False) general.add_option('-r', '--rate-limit', - dest='ratelimit', metavar='LIMIT', help='download rate limit (e.g. 50k or 44.6m)') + dest='ratelimit', metavar='LIMIT', help='maximum download rate (e.g. 50k or 44.6m)') general.add_option('-R', '--retries', dest='retries', metavar='RETRIES', help='number of retries (default is %default)', default=10) general.add_option('--buffer-size', @@ -286,12 +286,20 @@ def parseOpts(): xdg_config_home = os.environ.get('XDG_CONFIG_HOME') if xdg_config_home: - userConf = os.path.join(xdg_config_home, 'youtube-dl.conf') + userConfFile = os.path.join(xdg_config_home, 'youtube-dl.conf') else: - userConf = os.path.join(os.path.expanduser('~'), '.config', 'youtube-dl.conf') - argv = _readOptions('/etc/youtube-dl.conf') + _readOptions(userConf) + sys.argv[1:] + userConfFile = os.path.join(os.path.expanduser('~'), '.config', 'youtube-dl.conf') + systemConf = _readOptions('/etc/youtube-dl.conf') + userConf = _readOptions(userConfFile) + commandLineConf = sys.argv[1:] + argv = systemConf + userConf + commandLineConf opts, args = parser.parse_args(argv) + if opts.verbose: + print(u'[debug] System config: ' + repr(systemConf)) + print(u'[debug] User config: ' + repr(userConf)) + print(u'[debug] Command-line args: ' + repr(commandLineConf)) + return parser, opts, args def _real_main():