[options] Read ini files in windows
This commit is contained in:
parent
57e1fb6532
commit
7fada6e36e
@ -781,9 +781,10 @@ def parseOpts(overrideArguments=None):
|
|||||||
userConf = _readOptions(userConfFile, None)
|
userConf = _readOptions(userConfFile, None)
|
||||||
userIni = _readIni(userIniFile, None)
|
userIni = _readIni(userIniFile, None)
|
||||||
|
|
||||||
if userConf is None:
|
if userConf is None or userIni is None:
|
||||||
appdata_dir = compat_getenv('appdata')
|
appdata_dir = compat_getenv('appdata')
|
||||||
if appdata_dir:
|
if appdata_dir:
|
||||||
|
if userConf is None:
|
||||||
userConf = _readOptions(
|
userConf = _readOptions(
|
||||||
os.path.join(appdata_dir, 'youtube-dl', 'config'),
|
os.path.join(appdata_dir, 'youtube-dl', 'config'),
|
||||||
default=None)
|
default=None)
|
||||||
@ -791,6 +792,10 @@ def parseOpts(overrideArguments=None):
|
|||||||
userConf = _readOptions(
|
userConf = _readOptions(
|
||||||
os.path.join(appdata_dir, 'youtube-dl', 'config.txt'),
|
os.path.join(appdata_dir, 'youtube-dl', 'config.txt'),
|
||||||
default=None)
|
default=None)
|
||||||
|
if userIni is None:
|
||||||
|
userIni = _readIni(
|
||||||
|
os.path.join(appdata_dir, 'youtube-dl', 'config.ini'),
|
||||||
|
default=None)
|
||||||
|
|
||||||
if userConf is None:
|
if userConf is None:
|
||||||
userConf = _readOptions(
|
userConf = _readOptions(
|
||||||
@ -801,6 +806,15 @@ def parseOpts(overrideArguments=None):
|
|||||||
os.path.join(compat_expanduser('~'), 'youtube-dl.conf.txt'),
|
os.path.join(compat_expanduser('~'), 'youtube-dl.conf.txt'),
|
||||||
default=None)
|
default=None)
|
||||||
|
|
||||||
|
if userIni is None:
|
||||||
|
userIni = _readIni(
|
||||||
|
os.path.join(compat_expanduser('~'), 'youtube-dl.ini'),
|
||||||
|
default=None)
|
||||||
|
if userIni is None:
|
||||||
|
userIni = _readIni(
|
||||||
|
os.path.join(compat_expanduser('~'), 'youtube-dl.ini.txt'),
|
||||||
|
default=None)
|
||||||
|
|
||||||
if userConf is None:
|
if userConf is None:
|
||||||
userConf = []
|
userConf = []
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user