From 717b1f72ed6070212a72ac823547cb3c776a6264 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 27 Nov 2012 17:20:25 +0100 Subject: default info_dict['format'] to info_dict['ext'] and make the YT one more verbose --- youtube_dl/FileDownloader.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'youtube_dl/FileDownloader.py') diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py index b6aebe4ac..69d169904 100644 --- a/youtube_dl/FileDownloader.py +++ b/youtube_dl/FileDownloader.py @@ -355,6 +355,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) -- cgit v1.2.3 From 03c5b0fbd4de40ebf21a7ba2e389fb5fba50666c Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 27 Nov 2012 19:30:09 +0100 Subject: IE._WORKING attribute in order to warn the users and skip the tests on broken IEs --- youtube_dl/FileDownloader.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'youtube_dl/FileDownloader.py') diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py index 69d169904..1fdd2071f 100644 --- a/youtube_dl/FileDownloader.py +++ b/youtube_dl/FileDownloader.py @@ -481,6 +481,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 -- cgit v1.2.3 From f462df021a881c406afefc62bbf905ea582700ea Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 27 Nov 2012 23:15:33 +0100 Subject: Use None on missing required info_dict fields --- youtube_dl/FileDownloader.py | 1 + 1 file changed, 1 insertion(+) (limited to 'youtube_dl/FileDownloader.py') diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py index 1fdd2071f..a7997c4f2 100644 --- a/youtube_dl/FileDownloader.py +++ b/youtube_dl/FileDownloader.py @@ -327,6 +327,7 @@ class FileDownloader(object): template_dict = dict(info_dict) template_dict['epoch'] = unicode(int(time.time())) template_dict['autonumber'] = unicode('%05d' % self._num_downloads) + template_dict = dict((key, u'NA' if val is None else val) for key, val in template_dict.items()) filename = self.params['outtmpl'] % template_dict return filename except (ValueError, KeyError), err: -- cgit v1.2.3