2 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 class HeiseIE(InfoExtractor):
13 https?://(?:www\.)?heise\.de/video/artikel/
14 .+?(?P<id>[0-9]+)\.html(?:$|[?#])
18 'http://www.heise.de/video/artikel/Podcast-c-t-uplink-3-3-Owncloud-Tastaturen-Peilsender-Smartphone-2404147.html'
20 'md5': 'ffed432483e922e88545ad9f2f15d30e',
25 "Podcast: c't uplink 3.3 – Owncloud / Tastaturen / Peilsender Smartphone"
27 'format_id': 'mp4_720',
28 'timestamp': 1411812600,
29 'upload_date': '20140927',
33 def _real_extract(self, url):
34 video_id = self._match_id(url)
36 webpage = self._download_webpage(url, video_id)
37 json_url = self._search_regex(
38 r'json_url:\s*"([^"]+)"', webpage, 'json URL')
39 config = self._download_json(json_url, video_id)
43 'thumbnail': config.get('poster'),
44 'timestamp': parse_iso8601(get_meta_content('date', webpage)),
47 title = get_meta_content('fulltitle', webpage)
50 elif config.get('title'):
51 info['title'] = config['title']
53 info['title'] = self._og_search_title(webpage)
56 for t, rs in config['formats'].items():
57 if not rs or not hasattr(rs, 'items'):
58 self._downloader.report_warning(
59 'formats: {0}: no resolutions'.format(t))
62 for height_str, obj in rs.items():
63 format_id = '{0}_{1}'.format(t, height_str)
65 if not obj or not obj.get('url'):
66 self._downloader.report_warning(
67 'formats: {0}: no url'.format(format_id))
72 'format_id': format_id,
73 'height': self._int(height_str, 'height'),
76 self._sort_formats(formats)
77 info['formats'] = formats