diff options
author | pukkandan <pukkandan@gmail.com> | 2021-01-25 01:37:09 +0530 |
---|---|---|
committer | pukkandan <pukkandan@gmail.com> | 2021-01-25 01:52:47 +0530 |
commit | b5d265633da3cbf94a2905cc2aadec26f51cba53 (patch) | |
tree | 3f79dd749327775ebc6167699df5885810772157 | |
parent | a392adf56cd1636789a5f48edb43f6491d1a6049 (diff) | |
download | hypervideo-pre-b5d265633da3cbf94a2905cc2aadec26f51cba53.tar.lz hypervideo-pre-b5d265633da3cbf94a2905cc2aadec26f51cba53.tar.xz hypervideo-pre-b5d265633da3cbf94a2905cc2aadec26f51cba53.zip |
Fix wrong user config (Closes #32)
:ci skip dl
-rw-r--r-- | youtube_dlc/options.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/youtube_dlc/options.py b/youtube_dlc/options.py index 362cb6296..4910c2083 100644 --- a/youtube_dlc/options.py +++ b/youtube_dlc/options.py @@ -1217,19 +1217,15 @@ def parseOpts(overrideArguments=None): 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) - 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) + for package in ('yt-dlp', 'youtube-dlc'): if user: - config, current_path = config - if config is None: - return [], None - return config, current_path + 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']: |