- if re.match(r'\s*<div\s+class="video-error', info_webpage):
- raise ExtractorError(
- 'Video %s is blocked from your location.' % video_id,
- expected=True)
+ err_msg = self._html_search_regex(r'<div[^>]+class="video-error[^>]+>(.+)</div>', info_webpage, 'error message', default=None)
+ if err_msg:
+ err_msg = clean_html(err_msg)
+ if 'not available in your region' in err_msg:
+ raise ExtractorError(
+ 'Video %s is blocked from your location.' % video_id,
+ expected=True)
+ else:
+ raise ExtractorError('Viki said: ' + err_msg)