]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/liveleak.py
dd062a14e736ba84b3aacb9d3bf426bca4c8f86f
3 from .common
import InfoExtractor
9 class LiveLeakIE(InfoExtractor
):
11 _VALID_URL
= r
'^(?:http?://)?(?:\w+\.)?liveleak\.com/view\?(?:.*?)i=(?P<video_id>[\w_]+)(?:.*)'
14 u
'url': u
'http://www.liveleak.com/view?i=757_1364311680',
15 u
'file': u
'757_1364311680.mp4',
16 u
'md5': u
'0813c2430bea7a46bf13acf3406992f4',
18 u
"description": u
"extremely bad day for this guy..!",
19 u
"uploader": u
"ljfriel2",
20 u
"title": u
"Most unlucky car accident"
24 def _real_extract(self
, url
):
25 mobj
= re
.match(self
._VALID
_URL
, url
)
27 raise ExtractorError(u
'Invalid URL: %s' % url
)
29 video_id
= mobj
.group('video_id')
31 webpage
= self
._download
_webpage
(url
, video_id
)
33 video_url
= self
._search
_regex
(r
'file: "(.*?)",',
34 webpage
, u
'video URL')
36 video_title
= self
._og
_search
_title
(webpage
).replace('LiveLeak.com -', '').strip()
38 video_description
= self
._og
_search
_description
(webpage
)
40 video_uploader
= self
._html
_search
_regex
(r
'By:.*?(\w+)</a>',
41 webpage
, u
'uploader', fatal
=False)
48 'description': video_description
,
49 'uploader': video_uploader