# CONFIGURATION
-You can configure youtube-dl by placing default arguments (such as `--extract-audio --no-mtime` to always extract the audio and not copy the mtime) into `/etc/youtube-dl.conf` and/or `~/.config/youtube-dl.conf`. On Windows, the configuration file locations are `%APPDATA%\youtube-dl\config` and `C:\Users\<Yourname>\youtube-dl.conf`.
+You can configure youtube-dl by placing default arguments (such as `--extract-audio --no-mtime` to always extract the audio and not copy the mtime) into `/etc/youtube-dl.conf` and/or `~/.config/youtube-dl.conf`. On Windows, the configuration file locations are `%APPDATA%\youtube-dl\config.txt` and `C:\Users\<Yourname>\youtube-dl.conf`.
# OUTPUT TEMPLATE
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]
finally:
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 = []