# coding: utf-8
from __future__ import unicode_literals
-from .common import InfoExtractor
+from .wdr import WDRBaseIE
+from ..utils import get_element_by_attribute
-class SportschauIE(InfoExtractor):
+class SportschauIE(WDRBaseIE):
IE_NAME = 'Sportschau'
- _VALID_URL = r'https?://(?:www\.)?sportschau\.de/\w+(?:/\w+)?/video(?P<id>\w+)\.html'
+ _VALID_URL = r'https?://(?:www\.)?sportschau\.de/(?:[^/]+/)+video-?(?P<id>[^/#?]+)\.html'
_TEST = {
- 'url': 'http://www.sportschau.de/tourdefrance/videoseppeltkokainhatnichtsmitklassischemdopingzutun100.html',
- 'md5': 'a6ef460ab9f4089b079832e06d554cec',
+ 'url': 'http://www.sportschau.de/uefaeuro2016/videos/video-dfb-team-geht-gut-gelaunt-ins-spiel-gegen-polen-100.html',
'info_dict': {
- 'id': 'seppeltkokainhatnichtsmitklassischemdopingzutun100',
+ 'id': 'mdb-1140188',
+ 'display_id': 'dfb-team-geht-gut-gelaunt-ins-spiel-gegen-polen-100',
'ext': 'mp4',
- 'title': 'Seppelt: "Kokain hat nichts mit klassischem Doping zu tun" - Tour de France - sportschau.de',
- 'thumbnail': 're:^https?://.*\.jpg$',
- 'description': 'Der ARD-Doping Experte Hajo Seppelt gibt seine Einschätzung zum ersten Dopingfall der diesjährigen Tour de France um den Italiener Luca Paolini ab.',
- }
+ 'title': 'DFB-Team geht gut gelaunt ins Spiel gegen Polen',
+ 'description': 'Vor dem zweiten Gruppenspiel gegen Polen herrscht gute Stimmung im deutschen Team. Insbesondere Bastian Schweinsteiger strotzt vor Optimismus nach seinem Tor gegen die Ukraine.',
+ 'upload_date': '20160615',
+ },
+ 'skip': 'Geo-restricted to Germany',
}
def _real_extract(self, url):
video_id = self._match_id(url)
- ext = '-mc_defaultQuality-h.json'
- json_url = url[:-5] + ext
-
- json = self._download_json(json_url, video_id)
- thumb_url = json['_previewImage']
-
- m3u8_url = json['_mediaArray'][1]['_mediaStreamArray'][0]['_stream'][0]
- m3u8_formats = self._extract_m3u8_formats(m3u8_url, video_id, ext="mp4")
webpage = self._download_webpage(url, video_id)
- title = self._html_search_regex(r'<title>(.*?)</title>', webpage, 'title')
- desc = self._html_search_meta('description', webpage)
+ title = get_element_by_attribute('class', 'headline', webpage)
+ description = self._html_search_meta('description', webpage, 'description')
- return {
- 'id': video_id,
+ info = self._extract_wdr_video(webpage, video_id)
+
+ info.update({
'title': title,
- 'formats': m3u8_formats,
- 'description': desc,
- 'thumbnail': thumb_url,
- }
+ 'description': description,
+ })
+
+ return info