- nexx_id = self._search_regex(
- r'nexxOmniaId\s*:\s*(\d+)', webpage, 'nexx id', default=None)
- if nexx_id:
- domain_id = NexxIE._extract_domain_id(webpage) or '748'
- return self.url_result(
- 'nexx:%s:%s' % (domain_id, nexx_id), ie=NexxIE.ie_key(),
- video_id=nexx_id)
-
- video_data = extract_attributes(self._search_regex(r'(<div[^>]+id="spVideoElements"[^>]+>)', webpage, 'video element', default=''))
-
- title = video_data.get('data-video-title') or get_element_by_attribute('class', 'module-title', webpage)
- description = video_data.get('data-video-teaser') or self._html_search_meta('description', webpage, 'description')
-
- base_url = self._search_regex(
- [r'server\s*:\s*(["\'])(?P<url>.+?)\1', r'var\s+server\s*=\s*"(?P<url>[^"]+)\"'],
- webpage, 'server URL', group='url')
-
- xml_url = base_url + video_id + '.xml'
- idoc = self._download_xml(xml_url, video_id)
-
- formats = []
- for n in list(idoc):
- if n.tag.startswith('type') and n.tag != 'type6':
- format_id = n.tag.rpartition('type')[2]
- video_url = base_url + n.find('./filename').text
- formats.append({
- 'format_id': format_id,
- 'url': video_url,
- 'width': int(n.find('./width').text),
- 'height': int(n.find('./height').text),
- 'abr': int(n.find('./audiobitrate').text),
- 'vbr': int(n.find('./videobitrate').text),
- 'vcodec': n.find('./codec').text,
- 'acodec': 'MP4A',
- })
- duration = float(idoc[0].findall('./duration')[0].text)
-
- self._check_formats(formats, video_id)
- self._sort_formats(formats)
+ video_data = self._parse_json(self._webpage_read_content(
+ handle, metadata_url, video_id), video_id)
+ title = video_data['title']
+ nexx_id = video_data['nexxOmniaId']
+ domain_id = video_data.get('nexxOmniaDomain') or '748'