- 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)
+ webpage = self._download_webpage(
+ 'https://www.imdb.com/videoplayer/vi' + video_id, video_id)
+ video_metadata = self._parse_json(self._search_regex(
+ r'window\.IMDbReactInitialState\.push\(({.+?})\);', webpage,
+ 'video metadata'), video_id)['videos']['videoMetadata']['vi' + video_id]
+ title = self._html_search_meta(
+ ['og:title', 'twitter:title'], webpage) or self._html_search_regex(
+ r'<title>(.+?)</title>', webpage, 'title', fatal=False) or video_metadata['title']