1 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 class GoldenMoustacheIE(InfoExtractor):
12 _VALID_URL = r'https?://(?:www\.)?goldenmoustache\.com/(?P<display_id>[\w-]+)-(?P<id>\d+)'
14 'url': 'http://www.goldenmoustache.com/suricate-le-poker-3700/',
15 'md5': '0f904432fa07da5054d6c8beb5efb51a',
19 'title': 'Suricate - Le Poker',
20 'description': 'md5:3d1f242f44f8c8cb0a106f1fd08e5dc9',
21 'thumbnail': 'md5:fd41386bc1f932552622da4a7e9a7242',
25 def _real_extract(self, url):
26 mobj = re.match(self._VALID_URL, url)
27 video_id = mobj.group('id')
29 webpage = self._download_webpage(url, video_id)
31 video_url = self._html_search_regex(r'data-src-type="mp4" data-src="([^"]+)"', webpage, 'video URL')
33 title = self._html_search_regex(r'<title>(.*?) - Golden Moustache</title>', webpage, 'title')
35 thumbnail = self._html_search_meta('og:image', webpage, 'thumbnail')
37 description = self._html_search_meta('og:description', webpage, 'description')
39 view_count = int_or_none(self._html_search_regex(
40 r'<strong>(\d+)</strong>\s*VUES</span>', webpage, 'view count', fatal=False))
47 'description': description,
48 'thumbnail': thumbnail,
49 'view_count': view_count,