- # the video is in the following iframe
- iframe_url = 'http://www.sbs.com.au/ondemand/video/single/' + video_id + '?context=web'
- webpage = self._download_webpage(iframe_url, video_id)
-
- player_params = self._search_regex(
- r'(?s)(playerParams.+?releaseUrls.+?\n)',
- webpage, 'playerParams')
- player_params_js = self._search_regex(
- r'({.*})',
- player_params, 'player_param_js')
-
- player_params_json = self._parse_json(player_params_js, video_id)
-
- theplatform_url = player_params_json.get('releaseUrls')['progressive'] or player_params_json.get('releaseUrls')['standard']
+ error = player_params.get('error')
+ if error:
+ error_message = 'Sorry, The video you are looking for does not exist.'
+ video_data = error.get('results') or {}
+ error_code = error.get('errorCode')
+ if error_code == 'ComingSoon':
+ error_message = '%s is not yet available.' % video_data.get('title', '')
+ elif error_code in ('Forbidden', 'intranetAccessOnly'):
+ error_message = 'Sorry, This video cannot be accessed via this website'
+ elif error_code == 'Expired':
+ error_message = 'Sorry, %s is no longer available.' % video_data.get('title', '')
+ raise ExtractorError('%s said: %s' % (self.IE_NAME, error_message), expected=True)