]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/goldenmoustache.py
10001d4d95f9895c5e965f88c967aa87f63ff7f2
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
9 class GoldenMoustacheIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?goldenmoustache\.com/(?P<display_id>[\w-]+)-(?P<id>\d+)'
12 'url': 'http://www.goldenmoustache.com/suricate-le-poker-3700/',
13 'md5': '0f904432fa07da5054d6c8beb5efb51a',
17 'title': 'Suricate - Le Poker',
18 'description': 'md5:3d1f242f44f8c8cb0a106f1fd08e5dc9',
19 'thumbnail': 're:^https?://.*\.jpg$',
23 'url': 'http://www.goldenmoustache.com/le-lab-tout-effacer-mc-fly-et-carlito-55249/',
24 'md5': '27f0c50fb4dd5f01dc9082fc67cd5700',
28 'title': 'Le LAB - Tout Effacer (Mc Fly et Carlito)',
29 'description': 'md5:9b7fbf11023fb2250bd4b185e3de3b2a',
30 'thumbnail': 're:^https?://.*\.(?:png|jpg)$',
35 def _real_extract(self
, url
):
36 video_id
= self
._match
_id
(url
)
37 webpage
= self
._download
_webpage
(url
, video_id
)
39 video_url
= self
._html
_search
_regex
(
40 r
'data-src-type="mp4" data-src="([^"]+)"', webpage
, 'video URL')
41 title
= self
._html
_search
_regex
(
42 r
'<title>(.*?)(?: - Golden Moustache)?</title>', webpage
, 'title')
43 thumbnail
= self
._og
_search
_thumbnail
(webpage
)
44 description
= self
._og
_search
_description
(webpage
)
45 view_count
= int_or_none(self
._html
_search
_regex
(
46 r
'<strong>([0-9]+)</strong>\s*VUES</span>',
47 webpage
, 'view count', fatal
=False))
54 'description': description
,
55 'thumbnail': thumbnail
,
56 'view_count': view_count
,