3 from .common
import InfoExtractor
4 from .kaltura
import KalturaIE
5 from .youtube
import YoutubeIE
16 class HeiseIE(InfoExtractor
):
17 _VALID_URL
= r
'https?://(?:www\.)?heise\.de/(?:[^/]+/)+[^/]+-(?P<id>[0-9]+)\.html'
20 'url': 'http://www.heise.de/video/artikel/Podcast-c-t-uplink-3-3-Owncloud-Tastaturen-Peilsender-Smartphone-2404147.html',
24 'title': "Podcast: c't uplink 3.3 – Owncloud / Tastaturen / Peilsender Smartphone",
25 'timestamp': 1512734959,
26 'upload_date': '20171208',
27 'description': 'md5:c934cbfb326c669c2bcabcbe3d3fcd20',
28 'thumbnail': 're:^https?://.*/thumbnail/.*',
33 'skip_download': True,
37 'url': 'http://www.heise.de/newsticker/meldung/Netflix-In-20-Jahren-vom-Videoverleih-zum-TV-Revolutionaer-3814130.html',
38 'md5': 'e403d2b43fea8e405e88e3f8623909f1',
42 'title': 'Neu im September 2017 | Netflix',
43 'description': 'md5:d6852d1f96bb80760608eed3b907437c',
44 'upload_date': '20170830',
45 'uploader': 'Netflix Deutschland, Österreich und Schweiz',
46 'uploader_id': 'netflixdach',
47 'categories': ['Entertainment'],
50 'availability': 'public',
52 'channel_id': 'UCZqgRlLcvO3Fnx_npQJygcQ',
53 'thumbnail': 'https://i.ytimg.com/vi_webp/6kmWbXleKW4/maxresdefault.webp',
54 'uploader_url': 'http://www.youtube.com/user/netflixdach',
55 'playable_in_embed': True,
56 'live_status': 'not_live',
57 'channel_url': 'https://www.youtube.com/channel/UCZqgRlLcvO3Fnx_npQJygcQ',
59 'channel': 'Netflix Deutschland, Österreich und Schweiz',
60 'channel_follower_count': int,
65 'skip_download': True,
68 'url': 'https://www.heise.de/video/artikel/nachgehakt-Wie-sichert-das-c-t-Tool-Restric-tor-Windows-10-ab-3700244.html',
72 'title': "nachgehakt: Wie sichert das c't-Tool Restric'tor Windows 10 ab?",
73 'description': 'md5:47e8ffb6c46d85c92c310a512d6db271',
74 'timestamp': 1512470717,
75 'upload_date': '20171205',
78 'thumbnail': 're:^https?://.*/thumbnail/.*',
81 'skip_download': True,
84 # FIXME: Video m3u8 fails to download; issue with Kaltura extractor
85 'url': 'https://www.heise.de/ct/artikel/c-t-uplink-20-8-Staubsaugerroboter-Xiaomi-Vacuum-2-AR-Brille-Meta-2-und-Android-rooten-3959893.html',
89 'title': "c't uplink 20.8: Staubsaugerroboter Xiaomi Vacuum 2, AR-Brille Meta 2 und Android rooten",
90 'description': 'md5:f50fe044d3371ec73a8f79fcebd74afc',
91 'timestamp': 1517567237,
92 'upload_date': '20180202',
95 'skip_download': True,
99 'url': 'https://www.heise.de/ct/artikel/c-t-uplink-3-8-Anonyme-SIM-Karten-G-Sync-Monitore-Citizenfour-2440327.html',
103 'title': 'c\'t uplink 3.8: Anonyme SIM-Karten, G-Sync-Monitore, Citizenfour',
104 'thumbnail': 'http://www.heise.de/imagine/yxM2qmol0xV3iFB7qFb70dGvXjc/gallery/',
105 'description': 'md5:fa164d8c8707dff124a9626d39205f5d',
106 'timestamp': 1414825200,
107 'upload_date': '20141101',
110 'url': 'http://www.heise.de/ct/artikel/c-t-uplink-3-3-Owncloud-Tastaturen-Peilsender-Smartphone-2403911.html',
111 'only_matching': True,
113 'url': 'http://www.heise.de/newsticker/meldung/c-t-uplink-Owncloud-Tastaturen-Peilsender-Smartphone-2404251.html?wt_mc=rss.ho.beitrag.atom',
114 'only_matching': True,
116 'url': 'http://www.heise.de/ct/ausgabe/2016-12-Spiele-3214137.html',
117 'only_matching': True,
120 def _real_extract(self
, url
):
121 video_id
= self
._match
_id
(url
)
122 webpage
= self
._download
_webpage
(url
, video_id
)
124 def extract_title(default
=NO_DEFAULT
):
125 title
= self
._html
_search
_meta
(
126 ('fulltitle', 'title'), webpage
, default
=None)
127 if not title
or title
== "c't":
128 title
= self
._search
_regex
(
129 r
'<div[^>]+class="videoplayerjw"[^>]+data-title="([^"]+)"',
130 webpage
, 'title', default
=None)
132 title
= self
._html
_search
_regex
(
133 r
'<h1[^>]+\bclass=["\']article_page_title
[^
>]+>(.+?
)<',
134 webpage, 'title
', default=default)
137 title = extract_title(default=None)
138 description = self._og_search_description(
139 webpage, default=None) or self._html_search_meta(
140 'description
', webpage)
142 def _make_kaltura_result(kaltura_url):
144 '_type
': 'url_transparent
',
145 'url
': smuggle_url(kaltura_url, {'source_url
': url}),
146 'ie_key
': KalturaIE.ie_key(),
148 'description
': description,
151 kaltura_url = KalturaIE._extract_url(webpage)
153 return _make_kaltura_result(kaltura_url)
155 kaltura_id = self._search_regex(
156 r'entry
-id=(["\'])(?P<id>(?:(?!\1).)+)\1', webpage, 'kaltura id',
157 default=None, group='id')
159 return _make_kaltura_result(f'kaltura:2238431:{kaltura_id}')
161 yt_urls = tuple(YoutubeIE._extract_embed_urls(url, webpage))
163 return self.playlist_from_matches(
164 yt_urls, video_id, title, ie=YoutubeIE.ie_key())
166 title = extract_title()
167 api_params = urllib.parse.parse_qs(
168 self._search_regex(r'/videout/feed\.json\?([^\']+)', webpage, 'feed params', default=None) or '')
169 if not api_params or 'container' not in api_params or 'sequenz' not in api_params:
170 container_id = self._search_regex(
171 r'<div class="videoplayerjw
"[^>]+data-container="([0-9]+)"',
172 webpage, 'container ID')
174 sequenz_id = self._search_regex(
175 r'<div class="videoplayerjw
"[^>]+data-sequenz="([0-9]+)"',
176 webpage, 'sequenz ID')
178 'container': container_id,
179 'sequenz': sequenz_id,
181 doc = self._download_xml(
182 'http://www.heise.de/videout/feed', video_id, query=api_params)
185 for source_node in doc.findall('.//{http://rss.jwpcdn.com/}source'):
186 label = source_node.attrib['label']
187 height = int_or_none(self._search_regex(
188 r'^(.*?_)?([0-9]+)p$', label, 'height', default=None))
189 video_url = source_node.attrib['file']
190 ext = determine_ext(video_url, '')
193 'format_note': label,
194 'format_id': f'{ext}_{label}',
201 'description': description,
202 'thumbnail': (xpath_text(doc, './/{http://rss.jwpcdn.com/}image')
203 or self._og_search_thumbnail(webpage)),
204 'timestamp': parse_iso8601(
205 self._html_search_meta('date', webpage)),