aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/__init__.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-12-03 13:09:48 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-12-03 13:09:48 +0100
commitfb27c2295e0e9d6f2f6ac45ed5906987b4710d0a (patch)
treecdd0468298bb84d2f08da16ec0f3f5128dec7469 /youtube_dl/__init__.py
parent1b753cb3344837fb69e9bfde89d03161d33ba3ff (diff)
downloadyoutube-dl-fb27c2295e0e9d6f2f6ac45ed5906987b4710d0a.tar.xz
Correct configuration file locations
Diffstat (limited to 'youtube_dl/__init__.py')
-rw-r--r--youtube_dl/__init__.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py
index 32490b24e..9c8a694f0 100644
--- a/youtube_dl/__init__.py
+++ b/youtube_dl/__init__.py
@@ -81,11 +81,11 @@ from .PostProcessor import (
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:
@@ -435,12 +435,20 @@ def parseOpts(overrideArguments=None):
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 = []