]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/funnyordie.py
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
8 class FunnyOrDieIE(InfoExtractor
):
9 _VALID_URL
= r
'^(?:https?://)?(?:www\.)?funnyordie\.com/videos/(?P<id>[0-9a-f]+)/.*$'
11 'url': 'http://www.funnyordie.com/videos/0732f586d7/heart-shaped-box-literal-video-version',
12 'file': '0732f586d7.mp4',
13 'md5': 'f647e9e90064b53b6e046e75d0241fbd',
15 'description': ('Lyrics changed to match the video. Spoken cameo '
16 'by Obscurus Lupa (from ThatGuyWithTheGlasses.com). Based on a '
17 'concept by Dustin McLean (DustFilms.com). Performed, edited, '
18 'and written by David A. Scott.'),
19 'title': 'Heart-Shaped Box: Literal Video Version',
23 def _real_extract(self
, url
):
24 mobj
= re
.match(self
._VALID
_URL
, url
)
26 video_id
= mobj
.group('id')
27 webpage
= self
._download
_webpage
(url
, video_id
)
29 video_url
= self
._search
_regex
(
30 [r
'type="video/mp4" src="(.*?)"', r
'src="([^>]*?)" type=\'video
/mp4
\''],
31 webpage, 'video URL
', flags=re.DOTALL)
37 'title
': self._og_search_title(webpage),
38 'description
': self._og_search_description(webpage),