]>
Commit | Line | Data |
---|---|---|
b868c972 | 1 | from __future__ import unicode_literals |
2 | ||
b868c972 | 3 | from .common import InfoExtractor |
b868c972 | 4 | |
5 | ||
6 | class GoldenMoustacheIE(InfoExtractor): | |
7 | _VALID_URL = r'https?://(?:www\.)?goldenmoustache\.com/(?P<display_id>[\w-]+)-(?P<id>\d+)' | |
bbefcf04 | 8 | _TESTS = [{ |
b868c972 | 9 | 'url': 'http://www.goldenmoustache.com/suricate-le-poker-3700/', |
10 | 'md5': '0f904432fa07da5054d6c8beb5efb51a', | |
11 | 'info_dict': { | |
12 | 'id': '3700', | |
13 | 'ext': 'mp4', | |
14 | 'title': 'Suricate - Le Poker', | |
15 | 'description': 'md5:3d1f242f44f8c8cb0a106f1fd08e5dc9', | |
5ccaddf5 | 16 | 'thumbnail': 're:^https?://.*\.jpg$', |
b868c972 | 17 | } |
bbefcf04 PH |
18 | }, { |
19 | 'url': 'http://www.goldenmoustache.com/le-lab-tout-effacer-mc-fly-et-carlito-55249/', | |
20 | 'md5': '27f0c50fb4dd5f01dc9082fc67cd5700', | |
21 | 'info_dict': { | |
22 | 'id': '55249', | |
23 | 'ext': 'mp4', | |
24 | 'title': 'Le LAB - Tout Effacer (Mc Fly et Carlito)', | |
25 | 'description': 'md5:9b7fbf11023fb2250bd4b185e3de3b2a', | |
26 | 'thumbnail': 're:^https?://.*\.(?:png|jpg)$', | |
bbefcf04 PH |
27 | } |
28 | }] | |
b868c972 | 29 | |
30 | def _real_extract(self, url): | |
5ccaddf5 | 31 | video_id = self._match_id(url) |
b868c972 | 32 | webpage = self._download_webpage(url, video_id) |
33 | ||
5ccaddf5 PH |
34 | video_url = self._html_search_regex( |
35 | r'data-src-type="mp4" data-src="([^"]+)"', webpage, 'video URL') | |
36 | title = self._html_search_regex( | |
bbefcf04 | 37 | r'<title>(.*?)(?: - Golden Moustache)?</title>', webpage, 'title') |
5ccaddf5 PH |
38 | thumbnail = self._og_search_thumbnail(webpage) |
39 | description = self._og_search_description(webpage) | |
b868c972 | 40 | |
41 | return { | |
42 | 'id': video_id, | |
43 | 'url': video_url, | |
44 | 'ext': 'mp4', | |
45 | 'title': title, | |
46 | 'description': description, | |
47 | 'thumbnail': thumbnail, | |
b868c972 | 48 | } |