- # TODO more code goes here, for example ...
- webpage = self._download_webpage(url, video_id)
- title = self._html_search_regex(r'<title>(.*?)</title>', webpage, 'title')
- description = self._search_regex(r'<meta name="description" content="(.*)" />', webpage, 'video description')
- final_url = self._html_search_regex(r'mp4: \'(.*)\'', webpage, 'video url')
- height=int(self._search_regex(r'<meta name="video_height" content="([0-9]*)" />',webpage,"video height"))
- width=int(self._search_regex(r'<meta name="video_width" content="([0-9]*)" />',webpage,"video width"))
+ if '<error>true</error>' in playerapi:
+ error_desc = self._html_search_regex(
+ r'<errordesc>([^<]*)</errordesc>', playerapi, 'error description', fatal=False)
+ raise ExtractorError('%s said: %s' % (self.IE_NAME, error_desc), expected=True)
+
+ title = self._html_search_regex(
+ r'<title>([^<]+)</title>', playerapi, 'title')
+ video_url = self._html_search_regex(
+ r'<file>([^<]+)</file>', playerapi, 'video URL')
+ thumbnail = self._html_search_regex(
+ r'<preview>([^<]+)</preview>', playerapi, 'thumbnail', fatal=False)
+ duration = parse_duration(self._html_search_regex(
+ r'<duration>([^<]+)</duration>', playerapi, 'duration', fatal=False))