]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/phoenix.py
Imported Upstream version 2015.11.27.1
[youtubedl] / 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'''(?x)https?://(?:www\.)?phoenix\.de/content/
9 (?:
10 phoenix/die_sendungen/(?:[^/]+/)?
11 )?
12 (?P<id>[0-9]+)'''
13 _TESTS = [
14 {
15 'url': 'http://www.phoenix.de/content/884301',
16 'md5': 'ed249f045256150c92e72dbb70eadec6',
17 'info_dict': {
18 'id': '884301',
19 'ext': 'mp4',
20 'title': 'Michael Krons mit Hans-Werner Sinn',
21 'description': 'Im Dialog - Sa. 25.10.14, 00.00 - 00.35 Uhr',
22 'upload_date': '20141025',
23 'uploader': 'Im Dialog',
24 }
25 },
26 {
27 'url': 'http://www.phoenix.de/content/phoenix/die_sendungen/869815',
28 'only_matching': True,
29 },
30 {
31 'url': 'http://www.phoenix.de/content/phoenix/die_sendungen/diskussionen/928234',
32 'only_matching': True,
33 },
34 ]
35
36 def _real_extract(self, url):
37 video_id = self._match_id(url)
38 webpage = self._download_webpage(url, video_id)
39
40 internal_id = self._search_regex(
41 r'<div class="phx_vod" id="phx_vod_([0-9]+)"',
42 webpage, 'internal video ID')
43
44 api_url = 'http://www.phoenix.de/php/zdfplayer-v1.3/data/beitragsDetails.php?ak=web&id=%s' % internal_id
45 return extract_from_xml_url(self, video_id, api_url)