1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-15 22:05:39 +00:00

Add 'signature' to YouTube URLs, fixes #427

This commit is contained in:
Danko Alexeyev 2012-09-27 09:44:49 +03:00
parent b0d4f95899
commit 9ca667065e

View file

@ -402,7 +402,7 @@ class YoutubeIE(InfoExtractor):
url_data_strs = video_info['url_encoded_fmt_stream_map'][0].split(',') url_data_strs = video_info['url_encoded_fmt_stream_map'][0].split(',')
url_data = [parse_qs(uds) for uds in url_data_strs] url_data = [parse_qs(uds) for uds in url_data_strs]
url_data = filter(lambda ud: 'itag' in ud and 'url' in ud, url_data) url_data = filter(lambda ud: 'itag' in ud and 'url' in ud, url_data)
url_map = dict((ud['itag'][0], ud['url'][0]) for ud in url_data) url_map = dict((ud['itag'][0], ud['url'][0] + '&signature=' + ud['sig'][0]) for ud in url_data)
format_limit = self._downloader.params.get('format_limit', None) format_limit = self._downloader.params.get('format_limit', None)
available_formats = self._available_formats_prefer_free if self._downloader.params.get('prefer_free_formats', False) else self._available_formats available_formats = self._available_formats_prefer_free if self._downloader.params.get('prefer_free_formats', False) else self._available_formats