diff options
author | Ricardo Garcia <sarbalap+freshmeat@gmail.com> | 2010-12-11 11:34:10 +0100 |
---|---|---|
committer | Ricardo Garcia <sarbalap+freshmeat@gmail.com> | 2010-12-11 11:34:10 +0100 |
commit | 5c1327931a91fbc2f621b7f107255463bdf698b9 (patch) | |
tree | 5bc68a2e1241b1e23c3b019f615958e0c2b27aa2 | |
parent | 106d091e80f609802d3f6dcc3512525458900042 (diff) |
Stop attempting to use get_video and detect missing formats ourselves
-rwxr-xr-x | youtube-dl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/youtube-dl b/youtube-dl index 22b9eba17..8f895a5cb 100755 --- a/youtube-dl +++ b/youtube-dl @@ -947,7 +947,6 @@ class YoutubeIE(InfoExtractor): # Decide which formats to download req_format = self._downloader.params.get('format', None) - get_video_template = 'http://www.youtube.com/get_video?video_id=%s&t=%s&eurl=&el=&ps=&asv=&fmt=%%s' % (video_id, video_token) if 'fmt_url_map' in video_info: url_map = dict(tuple(pair.split('|')) for pair in video_info['fmt_url_map'][0].split(',')) @@ -965,10 +964,11 @@ class YoutubeIE(InfoExtractor): elif req_format == '-1': video_url_list = [(f, url_map[f]) for f in existing_formats] # All formats else: - if req_format in url_map: - video_url_list = [(req_format, url_map[req_format])] # Specific format - else: - video_url_list = [(req_format, get_video_template % req_format)] # Specific format + # Specific format + if req_format not in url_map: + self._downloader.trouble(u'ERROR: requested format not available') + return + video_url_list = [(req_format, url_map[req_format])] # Specific format elif 'conn' in video_info and video_info['conn'][0].startswith('rtmp'): self.report_rtmp_download() @@ -1002,7 +1002,7 @@ class YoutubeIE(InfoExtractor): 'player_url': player_url, }) except UnavailableVideoError, err: - self._downloader.trouble(u'ERROR: unable to download video (format may not be available)') + self._downloader.trouble(u'ERROR: unable to download video') class MetacafeIE(InfoExtractor): |