]>
Commit | Line | Data |
---|---|---|
dcdb292f | 1 | # coding: utf-8 |
2bcae58d PH |
2 | from __future__ import unicode_literals |
3 | ||
1fc0b47f | 4 | from .ard import ARDMediathekIE |
5 | from ..utils import ( | |
6 | ExtractorError, | |
7 | get_element_by_attribute, | |
8 | ) | |
2bcae58d | 9 | |
2bcae58d | 10 | |
1fc0b47f | 11 | class SRMediathekIE(ARDMediathekIE): |
81fda153 | 12 | IE_NAME = 'sr:mediathek' |
d2054761 | 13 | IE_DESC = 'Saarländischer Rundfunk' |
8cc9b401 | 14 | _VALID_URL = r'https?://sr-mediathek(?:\.sr-online)?\.de/index\.php\?.*?&id=(?P<id>[0-9]+)' |
2bcae58d | 15 | |
1fc0b47f | 16 | _TESTS = [{ |
2bcae58d PH |
17 | 'url': 'http://sr-mediathek.sr-online.de/index.php?seite=7&id=28455', |
18 | 'info_dict': { | |
19 | 'id': '28455', | |
20 | 'ext': 'mp4', | |
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 ', | |
ec85ded8 | 23 | 'thumbnail': r're:^https?://.*\.jpg$', |
2bcae58d | 24 | }, |
1fc0b47f | 25 | 'skip': 'no longer available', |
26 | }, { | |
27 | 'url': 'http://sr-mediathek.sr-online.de/index.php?seite=7&id=37682', | |
28 | 'info_dict': { | |
29 | 'id': '37682', | |
30 | 'ext': 'mp4', | |
31 | 'title': 'Love, Cakes and Rock\'n\'Roll', | |
32 | 'description': 'md5:18bf9763631c7d326c22603681e1123d', | |
33 | }, | |
34 | 'params': { | |
35 | # m3u8 download | |
36 | 'skip_download': True, | |
37 | }, | |
8cc9b401 RA |
38 | }, { |
39 | 'url': 'http://sr-mediathek.de/index.php?seite=7&id=7480', | |
40 | 'only_matching': True, | |
1fc0b47f | 41 | }] |
2bcae58d PH |
42 | |
43 | def _real_extract(self, url): | |
44 | video_id = self._match_id(url) | |
45 | webpage = self._download_webpage(url, video_id) | |
46 | ||
1fc0b47f | 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) | |
2bcae58d | 49 | |
1fc0b47f | 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) | |
53 | info.update({ | |
2bcae58d | 54 | 'id': video_id, |
1fc0b47f | 55 | 'title': get_element_by_attribute('class', 'ardplayer-title', webpage), |
2bcae58d PH |
56 | 'description': self._og_search_description(webpage), |
57 | 'thumbnail': self._og_search_thumbnail(webpage), | |
1fc0b47f | 58 | }) |
59 | return info |