4 from .common import InfoExtractor
10 class CinemassacreIE(InfoExtractor):
11 _VALID_URL = r'(?:http://)?(?:www\.)?(?P<url>cinemassacre\.com/(?P<date_Y>[0-9]{4})/(?P<date_m>[0-9]{2})/(?P<date_d>[0-9]{2})/.+?)(?:[/?].*)?'
13 u'url': u'http://cinemassacre.com/2012/11/10/avgn-the-movie-trailer/',
14 u'file': u'19911.flv',
15 u'md5': u'f9bb7ede54d1229c9846e197b4737e06',
17 u'upload_date': u'20121110',
18 u'title': u'“Angry Video Game Nerd: The Movie” – Trailer',
19 u'description': u'md5:fb87405fcb42a331742a0dce2708560b',
23 u'skip_download': True,
27 u'url': u'http://cinemassacre.com/2013/10/02/the-mummys-hand-1940',
28 u'file': u'521be8ef82b16.flv',
29 u'md5': u'91b248e1e2473d5bff55d6010518111f',
31 u'upload_date': u'20131002',
32 u'title': u'The Mummy’s Hand (1940)',
36 u'skip_download': True,
40 def _real_extract(self, url):
41 mobj = re.match(self._VALID_URL, url)
43 webpage_url = u'http://' + mobj.group('url')
44 webpage = self._download_webpage(webpage_url, None) # Don't know video id yet
45 video_date = mobj.group('date_Y') + mobj.group('date_m') + mobj.group('date_d')
46 mobj = re.search(r'src="(?P<embed_url>http://player\.screenwavemedia\.com/play/(?:embed|player)\.php\?id=(?:Cinemassacre-)?(?P<video_id>.+?))"', webpage)
48 raise ExtractorError(u'Can\'t extract embed url and video id')
49 playerdata_url = mobj.group(u'embed_url')
50 video_id = mobj.group(u'video_id')
52 video_title = self._html_search_regex(r'<title>(?P<title>.+?)\|',
54 video_description = self._html_search_regex(r'<div class="entry-content">(?P<description>.+?)</div>',
55 webpage, u'description', flags=re.DOTALL, fatal=False)
56 if len(video_description) == 0:
57 video_description = None
59 playerdata = self._download_webpage(playerdata_url, video_id)
60 url = self._html_search_regex(r'\'streamer\': \'(?P<url>[^\']+)\'', playerdata, u'url')
61 player_url = self._html_search_regex(r'\'flashplayer\': \'(?P<player_url>[^\']+)\'', playerdata, u'player_url')
62 page_url = re.split(r'(?<=[^/])/([^/]|$)', player_url)[0]
64 sd_file = self._html_search_regex(r'\'file\': \'(?P<sd_file>[^\']+)\'', playerdata, u'sd_file')
65 hd_file = self._html_search_regex(r'\'?file\'?: "(?P<hd_file>[^"]+)"', playerdata, u'hd_file')
66 video_thumbnail = self._html_search_regex(r'\'image\': \'(?P<thumbnail>[^\']+)\'', playerdata, u'thumbnail', fatal=False)
71 'player_url': player_url,
73 'play_path': 'mp4:' + sd_file,
80 'player_url': player_url,
82 'play_path': 'mp4:' + hd_file,
93 'description': video_description,
94 'upload_date': video_date,
95 'thumbnail': video_thumbnail,
97 # TODO: Remove when #980 has been merged
98 info.update(formats[-1])