2 from __future__ import unicode_literals
6 from .common import InfoExtractor
9 class EinthusanIE(InfoExtractor):
10 _VALID_URL = r'http://(?:www\.)?einthusan\.com/movies/watch.php\?(.*)?id=(?P<id>[0-9]+).*?'
13 'url': 'http://www.einthusan.com/movies/watch.php?id=2447',
14 'md5': 'af244f4458cd667205e513d75da5b8b1',
18 'title': 'Ek Villain',
19 'thumbnail': 're:^https?://.*\.jpg$',
23 'url': 'http://www.einthusan.com/movies/watch.php?id=1671',
24 'md5': 'ef63c7a803e22315880ed182c10d1c5c',
28 'title': 'Soodhu Kavvuum',
29 'thumbnail': 're:^https?://.*\.jpg$',
34 def _real_extract(self, url):
35 mobj = re.match(self._VALID_URL, url)
36 video_id = mobj.group('id')
37 webpage = self._download_webpage(url, video_id)
39 video_title = self._html_search_regex(r'''<h1><a class="movie-title".*?>(.*?)</a></h1>''', webpage, 'title')
41 video_url = self._html_search_regex(
42 r'''(?s)jwplayer\("mediaplayer"\)\.setup\({.*?'file': '([^']+)'.*?}\);''', webpage, 'video url')
44 thumb_rel_url = self._html_search_regex(
45 r'''<a class="movie-cover-wrapper".*?><img src=["'](.*?)["'].*?/></a>''', webpage, "thumbnail url")
46 thumb_abs_url = re.sub('\.\.', 'http://www.einthusan.com', thumb_rel_url)
53 'thumbnail': thumb_abs_url,