|
@ -31,6 +31,7 @@ from .utils import ( |
|
|
ContentTooShortError, |
|
|
ContentTooShortError, |
|
|
date_from_str, |
|
|
date_from_str, |
|
|
DateRange, |
|
|
DateRange, |
|
|
|
|
|
DEFAULT_OUTTMPL, |
|
|
determine_ext, |
|
|
determine_ext, |
|
|
DownloadError, |
|
|
DownloadError, |
|
|
encodeFilename, |
|
|
encodeFilename, |
|
@ -440,7 +441,8 @@ class YoutubeDL(object): |
|
|
if v is not None) |
|
|
if v is not None) |
|
|
template_dict = collections.defaultdict(lambda: 'NA', template_dict) |
|
|
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 |
|
|
filename = tmpl % template_dict |
|
|
return filename |
|
|
return filename |
|
|
except ValueError as err: |
|
|
except ValueError as err: |
|
@ -1025,10 +1027,11 @@ class YoutubeDL(object): |
|
|
|
|
|
|
|
|
def download(self, url_list): |
|
|
def download(self, url_list): |
|
|
"""Download a given list of URLs.""" |
|
|
"""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: |
|
|
for url in url_list: |
|
|
try: |
|
|
try: |
|
|