projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Document and test categories (#2923)
[youtube-dl]
/
youtube_dl
/
YoutubeDL.py
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index e9811bd055abcf9a0449c9b1e127a8d6ad7fd471..f3666573a5403f48e10de130374e1be9d835f46e 100755
(executable)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-31,6
+31,7
@@
from .utils import (
ContentTooShortError,
date_from_str,
DateRange,
ContentTooShortError,
date_from_str,
DateRange,
+ DEFAULT_OUTTMPL,
determine_ext,
DownloadError,
encodeFilename,
determine_ext,
DownloadError,
encodeFilename,
@@
-440,7
+441,8
@@
class YoutubeDL(object):
if v is not None)
template_dict = collections.defaultdict(lambda: 'NA', template_dict)
if v is not None)
template_dict = collections.defaultdict(lambda: 'NA', template_dict)
- tmpl = os.path.expanduser(self.params['outtmpl'])
+ outtmpl = self.params.get('outtmpl', DEFAULT_OUTTMPL)
+ tmpl = os.path.expanduser(outtmpl)
filename = tmpl % template_dict
return filename
except ValueError as err:
filename = tmpl % template_dict
return filename
except ValueError as err:
@@
-1025,10
+1027,11
@@
class YoutubeDL(object):
def download(self, url_list):
"""Download a given list of URLs."""
def download(self, url_list):
"""Download a given list of URLs."""
+ outtmpl = self.params.get('outtmpl', DEFAULT_OUTTMPL)
if (len(url_list) > 1 and
if (len(url_list) > 1 and
- '%' not in
self.params['outtmpl']
+ '%' not in
outtmpl
and self.params.get('max_downloads') != 1):
and self.params.get('max_downloads') != 1):
- raise SameFileError(
self.params['outtmpl']
)
+ raise SameFileError(
outtmpl
)
for url in url_list:
try:
for url in url_list:
try: