]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/wat.py
4 from .common
import InfoExtractor
11 class WatIE(InfoExtractor
):
12 _VALID_URL
=r
'http://www.wat.tv/.*-(?P<shortID>.*?)_.*?.html'
15 u
'url': u
'http://www.wat.tv/video/world-war-philadelphia-vost-6bv55_2fjr7_.html',
16 u
'file': u
'6bv55.mp4',
17 u
'md5': u
'0a4fe7870f31eaeabb5e25fd8da8414a',
19 u
"title": u
"World War Z - Philadelphia VOST"
23 def _real_extract(self
, url
):
24 mobj
= re
.match(self
._VALID
_URL
, url
)
25 short_id
= mobj
.group('shortID')
27 player_data
= compat_urllib_parse
.urlencode({'shortVideoId': short_id
,
29 player_info
= self
._download
_webpage
('http://www.wat.tv/player?' + player_data
,
30 short_id
, u
'Downloading player info')
31 player
= json
.loads(player_info
)['player']
32 html5_player
= self
._html
_search
_regex
(r
'iframe src="(.*?)"', player
,
34 player_webpage
= self
._download
_webpage
(html5_player
, short_id
,
35 u
'Downloading player webpage')
37 video_url
= self
._search
_regex
(r
'urlhtml5 : "(.*?)"', player_webpage
,
39 title
= self
._search
_regex
(r
'contentTitle : "(.*?)"', player_webpage
,
41 thumbnail
= self
._search
_regex
(r
'previewMedia : "(.*?)"', player_webpage
,
43 return {'id': short_id
,
47 'thumbnail': thumbnail
,