def parseOpts(overrideArguments=None):
- def _readOptions(filename_bytes, def=[]):
+ def _readOptions(filename_bytes, default=[]):
try:
optionf = open(filename_bytes)
except IOError:
- return def # silently skip if file is not present
+ return default # silently skip if file is not present
try:
- res = [shlex.split(l, comments=True) for l in optionf]
+ res = []
+ for l in optionf:
+ res += shlex.split(l, comments=True)
finally:
optionf.close()
return res
general.add_option('--extractor-descriptions',
action='store_true', dest='list_extractor_descriptions',
help='Output descriptions of all supported extractors', default=False)
- general.add_option('--proxy', dest='proxy', default=None, help='Use the specified HTTP/HTTPS proxy', metavar='URL')
+ general.add_option(
+ '--proxy', dest='proxy', default=None, metavar='URL',
+ help='Use the specified HTTP/HTTPS proxy. Pass in an empty string (--proxy "") for direct connection')
general.add_option('--no-check-certificate', action='store_true', dest='no_check_certificate', default=False, help='Suppress HTTPS certificate validation.')
general.add_option(
'--cache-dir', dest='cachedir', default=get_cachedir(), metavar='DIR',
if appdata_dir:
userConf = _readOptions(
os.path.join(appdata_dir, 'youtube-dl', 'config'),
- def=None)
+ default=None)
+ if userConf is None:
+ userConf = _readOptions(
+ os.path.join(appdata_dir, 'youtube-dl', 'config.txt'),
+ default=None)
if userConf is None:
- userConfFile = _readOptions(
+ userConf = _readOptions(
os.path.join(os.path.expanduser('~'), 'youtube-dl.conf'),
- def=None)
+ default=None)
+ if userConf is None:
+ userConf = _readOptions(
+ os.path.join(os.path.expanduser('~'), 'youtube-dl.conf.txt'),
+ default=None)
if userConf is None:
userConf = []