]> git.bitcoin.ninja Git - youtube-dl/blob - youtube_dl/extractor/phoenix.py
[generic] Add support for livestream embeds (Fixes #4185)
[youtube-dl] / youtube_dl / extractor / phoenix.py
1 from __future__ import unicode_literals
2
3 from .common import InfoExtractor
4 from .zdf import extract_from_xml_url
5
6
7 class PhoenixIE(InfoExtractor):
8     _VALID_URL = r'https?://(?:www\.)?phoenix\.de/content/(?P<id>[0-9]+)'
9     _TEST = {
10         'url': 'http://www.phoenix.de/content/884301',
11         'md5': 'ed249f045256150c92e72dbb70eadec6',
12         'info_dict': {
13             'id': '884301',
14             'ext': 'mp4',
15             'title': 'Michael Krons mit Hans-Werner Sinn',
16             'description': 'Im Dialog - Sa. 25.10.14, 00.00 - 00.35 Uhr',
17             'upload_date': '20141025',
18             'uploader': 'Im Dialog',
19         }
20     }
21
22     def _real_extract(self, url):
23         video_id = self._match_id(url)
24         webpage = self._download_webpage(url, video_id)
25
26         internal_id = self._search_regex(
27             r'<div class="phx_vod" id="phx_vod_([0-9]+)"',
28             webpage, 'internal video ID')
29
30         api_url = 'http://www.phoenix.de/php/zdfplayer-v1.3/data/beitragsDetails.php?ak=web&id=%s' % internal_id
31         return extract_from_xml_url(self, video_id, api_url)