1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-26 18:34:32 +01:00

[youtube] Skip get_video_info requests when --youtube-skip-dash-manifest is specified

This commit is contained in:
Sergey M․ 2015-06-27 14:31:18 +06:00
parent bc93bdb5bb
commit 0a3cf9ad3d

View File

@ -894,27 +894,28 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
# Convert to the same format returned by compat_parse_qs # Convert to the same format returned by compat_parse_qs
video_info = dict((k, [v]) for k, v in args.items()) video_info = dict((k, [v]) for k, v in args.items())
add_dash_mpd(video_info) add_dash_mpd(video_info)
# We also try looking in get_video_info since it may contain different dashmpd if not video_info or self._downloader.params.get('youtube_include_dash_manifest', True):
# URL that points to a DASH manifest with possibly different itag set (some itags # We also try looking in get_video_info since it may contain different dashmpd
# are missing from DASH manifest pointed by webpage's dashmpd, some - from DASH # URL that points to a DASH manifest with possibly different itag set (some itags
# manifest pointed by get_video_info's dashmpd). # are missing from DASH manifest pointed by webpage's dashmpd, some - from DASH
# The general idea is to take a union of itags of both DASH manifests (for example # manifest pointed by get_video_info's dashmpd).
# video with such 'manifest behavior' see https://github.com/rg3/youtube-dl/issues/6093) # The general idea is to take a union of itags of both DASH manifests (for example
self.report_video_info_webpage_download(video_id) # video with such 'manifest behavior' see https://github.com/rg3/youtube-dl/issues/6093)
for el_type in ['&el=info', '&el=embedded', '&el=detailpage', '&el=vevo', '']: self.report_video_info_webpage_download(video_id)
video_info_url = ( for el_type in ['&el=info', '&el=embedded', '&el=detailpage', '&el=vevo', '']:
'%s://www.youtube.com/get_video_info?&video_id=%s%s&ps=default&eurl=&gl=US&hl=en' video_info_url = (
% (proto, video_id, el_type)) '%s://www.youtube.com/get_video_info?&video_id=%s%s&ps=default&eurl=&gl=US&hl=en'
video_info_webpage = self._download_webpage( % (proto, video_id, el_type))
video_info_url, video_info_webpage = self._download_webpage(
video_id, note=False, video_info_url,
errnote='unable to download video info webpage') video_id, note=False,
get_video_info = compat_parse_qs(video_info_webpage) errnote='unable to download video info webpage')
add_dash_mpd(get_video_info) get_video_info = compat_parse_qs(video_info_webpage)
if not video_info: add_dash_mpd(get_video_info)
video_info = get_video_info if not video_info:
if 'token' in get_video_info: video_info = get_video_info
break if 'token' in get_video_info:
break
if 'token' not in video_info: if 'token' not in video_info:
if 'reason' in video_info: if 'reason' in video_info:
raise ExtractorError( raise ExtractorError(