aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/FileDownloader.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2012-11-27 23:23:37 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2012-11-27 23:23:37 +0100
commitc116339ddbe62d88b6295d519c03027070ec7d0d (patch)
treeea4756d1a633caa46e8107f7d5f10b5fbfec74b4 /youtube_dl/FileDownloader.py
parentdae7c920f633605167aed534a000c85b3096ba56 (diff)
parente643e2c6b7d9c2f09b3d4b3d163718aadf3d5edc (diff)
downloadyoutube-dl-c116339ddbe62d88b6295d519c03027070ec7d0d.tar.xz
Merge branch 'master' of github.com:rg3/youtube-dl
Diffstat (limited to 'youtube_dl/FileDownloader.py')
-rw-r--r--youtube_dl/FileDownloader.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py
index 4e9b55f49..870c82272 100644
--- a/youtube_dl/FileDownloader.py
+++ b/youtube_dl/FileDownloader.py
@@ -327,10 +327,13 @@ class FileDownloader(object):
"""Generate the output filename."""
try:
template_dict = dict(info_dict)
+
template_dict['epoch'] = int(time.time())
template_dict['autonumber'] = u'%05d' % self._num_downloads
+ template_dict = dict((key, u'NA' if val is None else val) for key, val in template_dict.items())
template_dict = dict((k, sanitize_filename(u(v), self.params.get('restrictfilenames'))) for k,v in template_dict.items())
+
filename = self.params['outtmpl'] % template_dict
return filename
except (ValueError, KeyError), err:
@@ -359,6 +362,9 @@ class FileDownloader(object):
# Keep for backwards compatibility
info_dict['stitle'] = info_dict['title']
+ if not 'format' in info_dict:
+ info_dict['format'] = info_dict['ext']
+
reason = self._match_entry(info_dict)
if reason is not None:
self.to_screen(u'[download] ' + reason)
@@ -481,6 +487,11 @@ class FileDownloader(object):
if not ie.suitable(url):
continue
+ # Warn if the _WORKING attribute is False
+ if not ie.working():
+ self.trouble(u'WARNING: the program functionality for this site has been marked as broken, '
+ u'and will probably not work. If you want to go on, use the -i option.')
+
# Suitable InfoExtractor found
suitable_found = True