]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/liveleak.py
cf8a2c9312a53d8fe3f16b363cce31b2dd7c989d
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
._html
_search
_regex
(r
'<meta property="og:title" content="(?P<title>.*?)"',
37 webpage
, u
'title').replace('LiveLeak.com -', '').strip()
39 video_description
= self
._html
_search
_regex
(r
'<meta property="og:description" content="(?P<desc>.*?)"',
40 webpage
, u
'description', fatal
=False)
42 video_uploader
= self
._html
_search
_regex
(r
'By:.*?(\w+)</a>',
43 webpage
, u
'uploader', fatal
=False)
50 'description': video_description
,
51 'uploader': video_uploader