1 # -*- coding: utf-8 -*-
5 from .common import InfoExtractor
7 class CriterionIE(InfoExtractor):
8 _VALID_URL = r'http://www.criterion.com/films/(.*)'
10 u'url': u'http://www.criterion.com/films/184-le-samourai',
12 u'md5': u'bc51beba55685509883a9a7830919ec3',
14 u"title": u"Le Samouraï",
15 u"description" : u"In a career-defining performance, Alain Delon plays a contract killer with samurai instincts. A razor-sharp cocktail of 1940s American gangster cinema and 1960s French pop culture, maverick director Jean-Pierre Melville's masterpiece _Le Samouraï_ defines cool. "
19 def _real_extract(self, url):
20 mobj = re.match(self._VALID_URL, url)
21 video_id = mobj.group(1).split('-')[0]
22 webpage = self._download_webpage(url, video_id)
24 final_url = self._search_regex(r'so.addVariable\("videoURL", "(.+?)"\)\;',
26 title = self._search_regex(r'<meta content="(.+?)" property="og:title" />',
27 webpage, 'video title')
28 description = self._search_regex(r'<meta name="description" content="(.+?)" />',
29 webpage, 'video description')
30 thumbnail = self._search_regex(r'so.addVariable\("thumbnailURL", "(.+?)"\)\;',
31 webpage, 'thumbnail url')
32 ext = final_url.split('.')[-1]
34 return {'id': video_id,
38 'description': description,
39 'thumbnail': thumbnail,