2 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from ..utils import unified_strdate
8 class DctpTvIE(InfoExtractor):
9 _VALID_URL = r'https?://(?:www\.)?dctp\.tv/(#/)?filme/(?P<id>.+?)/$'
11 'url': 'http://www.dctp.tv/filme/videoinstallation-fuer-eine-kaufhausfassade/',
12 'md5': '174dd4a8a6225cf5655952f969cfbe24',
14 'id': '95eaa4f33dad413aa17b4ee613cccc6c',
15 'display_id': 'videoinstallation-fuer-eine-kaufhausfassade',
17 'title': 'Videoinstallation für eine Kaufhausfassade',
18 'description': 'Kurzfilm',
19 'upload_date': '20110407',
20 'thumbnail': 're:^https?://.*\.jpg$',
24 def _real_extract(self, url):
25 video_id = self._match_id(url)
26 webpage = self._download_webpage(url, video_id)
28 object_id = self._html_search_meta('DC.identifier', webpage)
30 servers_json = self._download_json(
31 'http://www.dctp.tv/elastic_streaming_client/get_streaming_server/',
32 video_id, note='Downloading server list')
33 server = servers_json[0]['server']
34 m3u8_path = self._search_regex(
35 r'\'([^\'"]+/playlist\.m3u8)"', webpage, 'm3u8 path')
36 formats = self._extract_m3u8_formats(
37 'http://%s%s' % (server, m3u8_path), video_id, ext='mp4',
38 entry_protocol='m3u8_native')
40 title = self._og_search_title(webpage)
41 description = self._html_search_meta('DC.description', webpage)
42 upload_date = unified_strdate(
43 self._html_search_meta('DC.date.created', webpage))
44 thumbnail = self._og_search_thumbnail(webpage)
50 'display_id': video_id,
51 'description': description,
52 'upload_date': upload_date,
53 'thumbnail': thumbnail,