]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/liveleak.py
3 from .common
import InfoExtractor
9 class LiveLeakIE(InfoExtractor
):
11 _VALID_URL
= r
'^(?:http?://)?(?:\w+\.)?liveleak\.com/view\?(?:.*?)i=(?P<video_id>[\w_]+)(?:.*)'
14 def _real_extract(self
, url
):
15 mobj
= re
.match(self
._VALID
_URL
, url
)
17 raise ExtractorError(u
'Invalid URL: %s' % url
)
19 video_id
= mobj
.group('video_id')
21 webpage
= self
._download
_webpage
(url
, video_id
)
23 video_url
= self
._search
_regex
(r
'file: "(.*?)",',
24 webpage
, u
'video URL')
26 video_title
= self
._html
_search
_regex
(r
'<meta property="og:title" content="(?P<title>.*?)"',
27 webpage
, u
'title').replace('LiveLeak.com -', '').strip()
29 video_description
= self
._html
_search
_regex
(r
'<meta property="og:description" content="(?P<desc>.*?)"',
30 webpage
, u
'description', fatal
=False)
32 video_uploader
= self
._html
_search
_regex
(r
'By:.*?(\w+)</a>',
33 webpage
, u
'uploader', fatal
=False)
40 'description': video_description
,
41 'uploader': video_uploader