- if '>File does not exist<' in webpage:
- raise ExtractorError(
- 'Video %s does not exist' % video_id, expected=True)
-
- download_form = self._hidden_inputs(webpage)
- request = sanitized_Request(
- url, compat_urllib_parse.urlencode(download_form))
- request.add_header('Content-Type', 'application/x-www-form-urlencoded')
-
- video_page = self._download_webpage(
- request, video_id, 'Downloading video page')
-
- video_url = self._html_search_regex(
- r'data-url="([^"]+)"', video_page, 'video URL')
- title = base64.b64decode(self._html_search_meta(
- 'full:title', webpage, 'title').encode('utf-8')).decode('utf-8')
- filesize = int_or_none(self._html_search_meta(
- 'full:size', webpage, 'file size', fatal=False))
- thumbnail = self._html_search_regex(
- r'data-poster="([^"]+)"', video_page, 'thumbnail', default=None)
-
- return {
- 'id': video_id,
- 'url': video_url,
- 'ext': 'mp4',
- 'filesize': filesize,
- 'title': title,
- 'thumbnail': thumbnail,
- }
+ stream_url = url_or_none(decode_url(self._search_regex(
+ r'data-stream\s*=\s*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage,
+ 'stream url', default=None, group='url')))
+ if stream_url:
+ return stream_url
+ return self._parse_json(
+ self._search_regex(
+ r'InitializeStream\s*\(\s*(["\'])(?P<url>(?:(?!\1).)+)\1',
+ webpage, 'stream', group='url'),
+ video_id, transform_source=decode_url)[0]