- mobj = re.match(self._VALID_URL, url)
- self._id = mobj.group('id')
-
- html = self._download_webpage(url, self._id)
- config = self._download_json(self._parse_config_url(html), self._id)
-
- info = {
- 'id': self._id
- }
-
- title = get_meta_content('fulltitle', html)
- if title:
- info['title'] = title
- elif config.get('title'):
- info['title'] = config['title']
- else:
- self._warn('title: not found')
- info['title'] = 'heise'
-
- if (not config.get('formats') or
- not hasattr(config['formats'], 'items')):
- raise ExtractorError('No formats found')
+ video_id = self._match_id(url)
+ webpage = self._download_webpage(url, video_id)
+
+ def extract_title(default=NO_DEFAULT):
+ title = self._html_search_meta(
+ ('fulltitle', 'title'), webpage, default=None)
+ if not title or title == "c't":
+ title = self._search_regex(
+ r'<div[^>]+class="videoplayerjw"[^>]+data-title="([^"]+)"',
+ webpage, 'title', default=None)
+ if not title:
+ title = self._html_search_regex(
+ r'<h1[^>]+\bclass=["\']article_page_title[^>]+>(.+?)<',
+ webpage, 'title', default=default)
+ return title
+
+ title = extract_title(default=None)
+ description = self._og_search_description(
+ webpage, default=None) or self._html_search_meta(
+ 'description', webpage)
+
+ def _make_kaltura_result(kaltura_url):
+ return {
+ '_type': 'url_transparent',
+ 'url': smuggle_url(kaltura_url, {'source_url': url}),
+ 'ie_key': KalturaIE.ie_key(),
+ 'title': title,
+ 'description': description,
+ }
+
+ kaltura_url = KalturaIE._extract_url(webpage)
+ if kaltura_url:
+ return _make_kaltura_result(kaltura_url)
+
+ kaltura_id = self._search_regex(
+ r'entry-id=(["\'])(?P<id>(?:(?!\1).)+)\1', webpage, 'kaltura id',
+ default=None, group='id')
+ if kaltura_id:
+ return _make_kaltura_result('kaltura:2238431:%s' % kaltura_id)
+
+ yt_urls = YoutubeIE._extract_urls(webpage)
+ if yt_urls:
+ return self.playlist_from_matches(
+ yt_urls, video_id, title, ie=YoutubeIE.ie_key())
+
+ title = extract_title()
+
+ container_id = self._search_regex(
+ r'<div class="videoplayerjw"[^>]+data-container="([0-9]+)"',
+ webpage, 'container ID')
+
+ sequenz_id = self._search_regex(
+ r'<div class="videoplayerjw"[^>]+data-sequenz="([0-9]+)"',
+ webpage, 'sequenz ID')
+
+ doc = self._download_xml(
+ 'http://www.heise.de/videout/feed', video_id, query={
+ 'container': container_id,
+ 'sequenz': sequenz_id,
+ })