2 from __future__ import unicode_literals
4 from .ard import ARDMediathekIE
7 get_element_by_attribute,
11 class SRMediathekIE(ARDMediathekIE):
12 IE_NAME = 'sr:mediathek'
13 IE_DESC = 'Saarländischer Rundfunk'
14 _VALID_URL = r'https?://sr-mediathek(?:\.sr-online)?\.de/index\.php\?.*?&id=(?P<id>[0-9]+)'
17 'url': 'http://sr-mediathek.sr-online.de/index.php?seite=7&id=28455',
21 'title': 'sportarena (26.10.2014)',
22 'description': 'Ringen: KSV Köllerbach gegen Aachen-Walheim; Frauen-Fußball: 1. FC Saarbrücken gegen Sindelfingen; Motorsport: Rallye in Losheim; dazu: Interview mit Timo Bernhard; Turnen: TG Saar; Reitsport: Deutscher Voltigier-Pokal; Badminton: Interview mit Michael Fuchs ',
23 'thumbnail': r're:^https?://.*\.jpg$',
25 'skip': 'no longer available',
27 'url': 'http://sr-mediathek.sr-online.de/index.php?seite=7&id=37682',
31 'title': 'Love, Cakes and Rock\'n\'Roll',
32 'description': 'md5:18bf9763631c7d326c22603681e1123d',
36 'skip_download': True,
39 'url': 'http://sr-mediathek.de/index.php?seite=7&id=7480',
40 'only_matching': True,
43 def _real_extract(self, url):
44 video_id = self._match_id(url)
45 webpage = self._download_webpage(url, video_id)
47 if '>Der gewünschte Beitrag ist leider nicht mehr verfügbar.<' in webpage:
48 raise ExtractorError('Video %s is no longer available' % video_id, expected=True)
50 media_collection_url = self._search_regex(
51 r'data-mediacollection-ardplayer="([^"]+)"', webpage, 'media collection url')
52 info = self._extract_media_info(media_collection_url, webpage, video_id)
55 'title': get_element_by_attribute('class', 'ardplayer-title', webpage),
56 'description': self._og_search_description(webpage),
57 'thumbnail': self._og_search_thumbnail(webpage),