]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/liveleak.py
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
11 class LiveLeakIE(InfoExtractor
):
12 _VALID_URL
= r
'^(?:http://)?(?:\w+\.)?liveleak\.com/view\?(?:.*?)i=(?P<video_id>[\w_]+)(?:.*)'
14 'url': 'http://www.liveleak.com/view?i=757_1364311680',
15 'file': '757_1364311680.mp4',
16 'md5': '0813c2430bea7a46bf13acf3406992f4',
18 'description': 'extremely bad day for this guy..!',
19 'uploader': 'ljfriel2',
20 'title': 'Most unlucky car accident'
24 def _real_extract(self
, url
):
25 mobj
= re
.match(self
._VALID
_URL
, url
)
27 video_id
= mobj
.group('video_id')
28 webpage
= self
._download
_webpage
(url
, video_id
)
29 video_url
= self
._search
_regex
(
30 r
'file: "(.*?)",', webpage
, 'video URL')
32 video_title
= self
._og
_search
_title
(webpage
).replace('LiveLeak.com -', '').strip()
33 video_description
= self
._og
_search
_description
(webpage
)
34 video_uploader
= self
._html
_search
_regex
(
35 r
'By:.*?(\w+)</a>', webpage
, 'uploader', fatal
=False)
42 'description': video_description
,
43 'uploader': video_uploader