- 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)
- available_formats = re.findall(
- r'case \'(?P<f_id>.*?)\' :$\s+url = \'(?P<path>.*?)\'', webpage,
- flags=re.MULTILINE)
+ 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']
+
+ quality = qualities(('SD', '480p', '720p', '1080p'))