[youtube] Include video Id in common error message (Fixes #2786)

This commit is contained in:
Philipp Hagemeister 2014-04-21 20:34:03 +02:00
parent 1d9d26d09b
commit d11271dd29
2 changed files with 10 additions and 3 deletions

View file

@ -1082,9 +1082,13 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
break
if 'token' not in video_info:
if 'reason' in video_info:
raise ExtractorError(u'YouTube said: %s' % video_info['reason'][0], expected=True)
raise ExtractorError(
u'YouTube said: %s' % video_info['reason'][0],
expected=True, video_id=video_id)
else:
raise ExtractorError(u'"token" parameter not in video info for unknown reason')
raise ExtractorError(
u'"token" parameter not in video info for unknown reason',
video_id=video_id)
if 'view_count' in video_info:
view_count = int(video_info['view_count'][0])