mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 03:33:02 +00:00
parent
a392adf56c
commit
b5d265633d
1 changed files with 8 additions and 12 deletions
|
@ -1217,19 +1217,15 @@ def get_configs():
|
|||
return
|
||||
|
||||
def read_options(path, user=False):
|
||||
func = _readUserConf if user else _readOptions
|
||||
current_path = os.path.join(path, 'yt-dlp.conf')
|
||||
config = func(current_path, default=None)
|
||||
for package in ('yt-dlp', 'youtube-dlc'):
|
||||
if user:
|
||||
config, current_path = config
|
||||
if config is None:
|
||||
current_path = os.path.join(path, 'youtube-dlc.conf')
|
||||
config = func(current_path, default=None)
|
||||
if user:
|
||||
config, current_path = config
|
||||
if config is None:
|
||||
return [], None
|
||||
config, current_path = _readUserConf(package, default=None)
|
||||
else:
|
||||
current_path = os.path.join(path, '%s.conf' % package)
|
||||
config = _readOptions(current_path, default=None)
|
||||
if config is not None:
|
||||
return config, current_path
|
||||
return [], None
|
||||
|
||||
configs['portable'], paths['portable'] = read_options(get_executable_path())
|
||||
if '--ignore-config' in configs['portable']:
|
||||
|
|
Loading…
Reference in a new issue