]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/internetvideoarchive.py
1 from __future__
import unicode_literals
6 from .common
import InfoExtractor
13 class InternetVideoArchiveIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://video\.internetvideoarchive\.net/(?:player|flash/players)/.*?\?.*?publishedid.*?'
17 'url': 'http://video.internetvideoarchive.net/player/6/configuration.ashx?customerid=69249&publishedid=194487&reporttag=vdbetatitle&playerid=641&autolist=0&domain=www.videodetective.com&maxrate=high&minrate=low&socialplayer=false',
21 'title': 'Kick-Ass 2',
22 'description': 'md5:c189d5b7280400630a1d3dd17eaa8d8a',
26 'skip_download': True,
31 def _build_json_url(query
):
32 return 'http://video.internetvideoarchive.net/player/6/configuration.ashx?' + query
34 def _real_extract(self
, url
):
35 query
= compat_parse_qs(compat_urlparse
.urlparse(url
).query
)
36 video_id
= query
['publishedid'][0]
37 data
= self
._download
_json
(
38 'https://video.internetvideoarchive.net/videojs7/videojs7.ivasettings.ashx',
39 video_id
, data
=json
.dumps({
40 'customerid': query
['customerid'][0],
41 'publishedid': video_id
,
44 formats
= self
._extract
_m
3u8_formats
(
45 data
['VideoUrl'], video_id
, 'mp4',
46 'm3u8_native', m3u8_id
='hls', fatal
=False)
47 file_url
= formats
[0]['url']
48 if '.ism/' in file_url
:
49 replace_url
= lambda x
: re
.sub(r
'\.ism/[^?]+', '.ism/' + x
, file_url
)
50 formats
.extend(self
._extract
_f
4m
_formats
(
51 replace_url('.f4m'), video_id
, f4m_id
='hds', fatal
=False))
52 formats
.extend(self
._extract
_mpd
_formats
(
53 replace_url('.mpd'), video_id
, mpd_id
='dash', fatal
=False))
54 formats
.extend(self
._extract
_ism
_formats
(
55 replace_url('Manifest'), video_id
, ism_id
='mss', fatal
=False))
56 self
._sort
_formats
(formats
)
62 'thumbnail': data
.get('PosterUrl'),
63 'description': data
.get('Description'),