X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=inline;f=youtube_dl%2F__init__.py;h=6a1a9bb52e9471aed8aa40132742a743e3babb17;hb=04f3d551a0b49ffede5467138d56cb3fceacaa1d;hp=c4f64893d491f8e6f9927fd644b967cf0d9c3542;hpb=b9fc428494b22623529d364387b8693cc3cb1503;p=youtube-dl diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index c4f64893d..6a1a9bb52 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -24,6 +24,7 @@ __authors__ = ( 'Jaime Marquínez Ferrándiz', 'Jeff Crouse', 'Osama Khalid', + 'Michael Walter', ) __license__ = 'Public Domain' @@ -126,7 +127,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 +287,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():