]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/dctp.py
aa2c09eb686f9da5a7bedfdfe57566e9d29a0700
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..compat
import compat_str
8 class DctpTvIE(InfoExtractor
):
9 _VALID_URL
= r
'http://www.dctp.tv/(#/)?filme/(?P<id>.+?)/$'
11 'url': 'http://www.dctp.tv/filme/videoinstallation-fuer-eine-kaufhausfassade/',
14 'display_id': 'videoinstallation-fuer-eine-kaufhausfassade',
16 'title': 'Videoinstallation für eine Kaufhausfassade'
20 'skip_download': True,
24 def _real_extract(self
, url
):
25 video_id
= self
._match
_id
(url
)
26 base_url
= 'http://dctp-ivms2-restapi.s3.amazonaws.com/'
27 version_json
= self
._download
_json
(
28 base_url
+ 'version.json',
29 video_id
, note
='Determining file version')
30 version
= version_json
['version_name']
31 info_json
= self
._download
_json
(
32 '{0}{1}/restapi/slugs/{2}.json'.format(base_url
, version
, video_id
),
33 video_id
, note
='Fetching object ID')
34 object_id
= compat_str(info_json
['object_id'])
35 meta_json
= self
._download
_json
(
36 '{0}{1}/restapi/media/{2}.json'.format(base_url
, version
, object_id
),
37 video_id
, note
='Downloading metadata')
38 uuid
= meta_json
['uuid']
39 title
= meta_json
['title']
40 wide
= meta_json
['is_wide']
45 play_path
= 'mp4:{0}_dctp_0500_{1}.m4v'.format(uuid
, ratio
)
47 servers_json
= self
._download
_json
(
48 'http://www.dctp.tv/streaming_servers/',
49 video_id
, note
='Downloading server list')
50 url
= servers_json
[0]['endpoint']
57 'play_path': play_path
,
58 'rtmp_real_time': True,
60 'display_id': video_id