[vimeo] Fix error parsing

This commit is contained in:
Lukáš Lalinský 2015-10-20 10:30:31 +02:00
parent 7b091c370c
commit b6aa99aff8

View file

@ -273,13 +273,13 @@ def _real_extract(self, url):
self.report_extraction(video_id) self.report_extraction(video_id)
vimeo_config = self._search_regex( vimeo_config = self._search_regex(
r'vimeo\.config\s*=\s*({.+?});', webpage, r'vimeo\.config\s*=\s*(?:({.+?})|_extend\([^,]+,\s+({.+?})\));', webpage,
'vimeo config', default=None) 'vimeo config', default=None)
if vimeo_config: if vimeo_config:
seed_status = self._parse_json(vimeo_config, video_id).get('seed_status', {}) seed_status = self._parse_json(vimeo_config, video_id).get('seed_status', {})
if seed_status.get('state') == 'failed': if seed_status.get('state') == 'failed':
raise ExtractorError( raise ExtractorError(
'%s returned error: %s' % (self.IE_NAME, seed_status['title']), '%s said: %s' % (self.IE_NAME, seed_status['title']),
expected=True) expected=True)
# Extract the config JSON # Extract the config JSON