1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
6 from .common import InfoExtractor
9 class TagesschauIE(InfoExtractor):
10 _VALID_URL = r'https?://(?:www\.)?tagesschau\.de/multimedia/video/video(?P<id>-?\d+)\.html'
13 'url': 'http://www.tagesschau.de/multimedia/video/video1399128.html',
14 'md5': 'bcdeac2194fb296d599ce7929dfa4009',
18 'title': 'Harald Range, Generalbundesanwalt, zu den Ermittlungen',
19 'description': 'md5:69da3c61275b426426d711bde96463ab',
20 'thumbnail': 're:^http:.*\.jpg$',
23 'url': 'http://www.tagesschau.de/multimedia/video/video-196.html',
24 'md5': '8aaa8bf3ae1ca2652309718c03019128',
28 'title': 'Ukraine-Konflikt: Klitschko in Kiew als B\xfcrgermeister vereidigt',
29 'description': 'md5:f22e4af75821d174fa6c977349682691',
30 'thumbnail': 're:http://.*\.jpg',
34 def _real_extract(self, url):
35 mobj = re.match(self._VALID_URL, url)
36 video_id = mobj.group('id')
38 if video_id.startswith('-'):
39 display_id = video_id.strip('-')
43 webpage = self._download_webpage(url, display_id)
45 playerpage = self._download_webpage(
46 'http://www.tagesschau.de/multimedia/video/video%s~player_autoplay-true.html' % video_id, display_id, 'Downloading player page')
48 medias = re.findall(r'"(http://media.+?)", type:"video/(.+?)", quality:"(.+?)"', playerpage)
51 for url, ext, res in medias:
64 'format_id': res+'_'+ext,
70 self._sort_formats(formats)
72 thumbnail = re.findall(r'"(/multimedia/.+?\.jpg)"', playerpage)[-1]
76 'title': self._og_search_title(webpage).strip(),
77 'thumbnail': 'http://www.tagesschau.de'+thumbnail,
79 'description': self._og_search_description(webpage).strip(),