- info = self._download_json(
- 'https://api-v2.redbull.tv/views/%s' % video_id,
- video_id, note='Downloading video information',
- headers={'Authorization': 'Bearer ' + access_token}
- )['blocks'][0]['top'][0]
+ try:
+ info = self._download_json(
+ 'https://api-v2.redbull.tv/content/%s' % video_id,
+ video_id, note='Downloading video information',
+ headers={'Authorization': auth}
+ )
+ except ExtractorError as e:
+ if isinstance(e.cause, compat_HTTPError) and e.cause.code == 404:
+ error_message = self._parse_json(
+ e.cause.read().decode(), video_id)['message']
+ raise ExtractorError('%s said: %s' % (
+ self.IE_NAME, error_message), expected=True)
+ raise