]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/jeuxvideo.py
4 from .common
import InfoExtractor
6 class JeuxVideoIE(InfoExtractor
):
7 _VALID_URL
= r
'http://.*?\.jeuxvideo\.com/.*/(.*?)-\d+\.htm'
9 def _real_extract(self
, url
):
10 mobj
= re
.match(self
._VALID
_URL
, url
)
11 title
= re
.match(self
._VALID
_URL
, url
).group(1)
12 webpage
= self
._download
_webpage
(url
, title
)
13 m_download
= re
.search(r
'<param name="flashvars" value="config=(.*?)" />', webpage
)
15 xml_link
= m_download
.group(1)
17 id = re
.search(r
'http://www.jeuxvideo.com/config/\w+/0011/(.*?)/\d+_player\.xml', xml_link
).group(1)
19 xml_config
= self
._download
_webpage
(xml_link
, title
,
20 'Downloading XML config')
21 info
= re
.search(r
'<format\.json>(.*?)</format\.json>',
22 xml_config
, re
.MULTILINE|re
.DOTALL
).group(1)
23 info
= json
.loads(info
)['versions'][0]
25 video_url
= 'http://video720.jeuxvideo.com/' + info
['file']
27 track_info
= {'id':id,