- _VIDEO_ID_REGEXES = (
- r'"eVar42"\s*:\s*(\d+)',
- r'Ginger\.TeamCoco\.openInApp\("video",\s*"([^"]+)"',
- r'"id_not"\s*:\s*(\d+)'
- )
-
- def _real_extract(self, url):
- mobj = re.match(self._VALID_URL, url)
-
- display_id = mobj.group('display_id')
- webpage, urlh = self._download_webpage_handle(url, display_id)
- if 'src=expired' in urlh.geturl():
- raise ExtractorError('This video is expired.', expected=True)
-
- video_id = mobj.group('video_id')
- if not video_id:
- video_id = self._html_search_regex(
- self._VIDEO_ID_REGEXES, webpage, 'video id')
-
- data = None
-
- preload_codes = self._html_search_regex(
- r'(function.+)setTimeout\(function\(\)\{playlist',
- webpage, 'preload codes')
- base64_fragments = re.findall(r'"([a-zA-Z0-9+/=]+)"', preload_codes)
- base64_fragments.remove('init')