- webpage = self._download_webpage('http://www.imdb.com/video/imdb/vi%s' % video_id, video_id)
- descr = self._html_search_regex(
- r'(?s)<span itemprop="description">(.*?)</span>',
- webpage, 'description', fatal=False)
- player_url = 'http://www.imdb.com/video/imdb/vi%s/imdb/single' % video_id
- player_page = self._download_webpage(
- player_url, video_id, 'Downloading player page')
- # the player page contains the info for the default format, we have to
- # fetch other pages for the rest of the formats
- extra_formats = re.findall(r'href="(?P<url>%s.*?)".*?>(?P<name>.*?)<' % re.escape(player_url), player_page)
- format_pages = [
- self._download_webpage(
- f_url, video_id, 'Downloading info for %s format' % f_name)
- for f_url, f_name in extra_formats]
- format_pages.append(player_page)
+
+ data = self._download_json(
+ 'https://www.imdb.com/ve/data/VIDEO_PLAYBACK_DATA', video_id,
+ query={
+ 'key': base64.b64encode(json.dumps({
+ 'type': 'VIDEO_PLAYER',
+ 'subType': 'FORCE_LEGACY',
+ 'id': 'vi%s' % video_id,
+ }).encode()).decode(),
+ })[0]