diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2011-08-06 11:05:57 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2011-08-06 11:05:57 +0200 |
commit | f137bef973729bf1da0f8dfe244d5ff24cb2ad23 (patch) | |
tree | 6e0bd430569af4a4603897d2a3bca3f40b7915cf | |
parent | 0ac22e4f5a652f1b470f9daff06c1361e8f93c16 (diff) | |
download | youtube-dl-f137bef973729bf1da0f8dfe244d5ff24cb2ad23.tar.xz |
Fix RTMP streams and ignore url-less entries
-rwxr-xr-x | youtube-dl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/youtube-dl b/youtube-dl index 0d77585a8..76d41c448 100755 --- a/youtube-dl +++ b/youtube-dl @@ -1248,9 +1248,14 @@ class YoutubeIE(InfoExtractor): # Decide which formats to download req_format = self._downloader.params.get('format', None) - if 'url_encoded_fmt_stream_map' in video_info and len(video_info['url_encoded_fmt_stream_map']) >= 1: + if 'conn' in video_info and video_info['conn'][0].startswith('rtmp'): + self.report_rtmp_download() + video_url_list = [(None, video_info['conn'][0])] + print(repr(video_info['conn'][0])) + elif 'url_encoded_fmt_stream_map' in video_info and len(video_info['url_encoded_fmt_stream_map']) >= 1: url_data_strs = video_info['url_encoded_fmt_stream_map'][0].split(',') url_data = [dict(pairStr.split('=') for pairStr in uds.split('&')) for uds in url_data_strs] + url_data = filter(lambda ud: 'itag' in ud and 'url' in ud, url_data) url_map = dict((ud['itag'], urllib.unquote(ud['url'])) for ud in url_data) format_limit = self._downloader.params.get('format_limit', None) @@ -1272,11 +1277,6 @@ class YoutubeIE(InfoExtractor): 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() - video_url_list = [(None, video_info['conn'][0])] - else: self._downloader.trouble(u'ERROR: no fmt_url_map or conn information found in video info') return |