fix token not in video infor bug
This commit is contained in:
parent
50d660479d
commit
a8391b4648
@ -1677,9 +1677,10 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||||||
unavailable_message = 'Unable to extract video data'
|
unavailable_message = 'Unable to extract video data'
|
||||||
raise ExtractorError(
|
raise ExtractorError(
|
||||||
'YouTube said: %s' % unavailable_message, expected=True, video_id=video_id)
|
'YouTube said: %s' % unavailable_message, expected=True, video_id=video_id)
|
||||||
|
|
||||||
if 'token' not in video_info:
|
if 'token' not in video_info:
|
||||||
if 'reason' in video_info:
|
if 'account_playback_token' in video_info:
|
||||||
|
video_info['token'] = video_info['account_playback_token']
|
||||||
|
elif 'reason' in video_info:
|
||||||
if 'The uploader has not made this video available in your country.' in video_info['reason']:
|
if 'The uploader has not made this video available in your country.' in video_info['reason']:
|
||||||
regions_allowed = self._html_search_meta(
|
regions_allowed = self._html_search_meta(
|
||||||
'regionsAllowed', video_webpage, default=None)
|
'regionsAllowed', video_webpage, default=None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user