]>
Commit | Line | Data |
---|---|---|
c968f738 | 1 | from .ard import ARDMediathekBaseIE |
1fc0b47f | 2 | from ..utils import ( |
3 | ExtractorError, | |
4 | get_element_by_attribute, | |
5 | ) | |
2bcae58d | 6 | |
2bcae58d | 7 | |
c968f738 | 8 | class SRMediathekIE(ARDMediathekBaseIE): |
81fda153 | 9 | IE_NAME = 'sr:mediathek' |
d2054761 | 10 | IE_DESC = 'Saarländischer Rundfunk' |
8cc9b401 | 11 | _VALID_URL = r'https?://sr-mediathek(?:\.sr-online)?\.de/index\.php\?.*?&id=(?P<id>[0-9]+)' |
2bcae58d | 12 | |
1fc0b47f | 13 | _TESTS = [{ |
2bcae58d PH |
14 | 'url': 'http://sr-mediathek.sr-online.de/index.php?seite=7&id=28455', |
15 | 'info_dict': { | |
16 | 'id': '28455', | |
17 | 'ext': 'mp4', | |
18 | 'title': 'sportarena (26.10.2014)', | |
19 | '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 | 20 | 'thumbnail': r're:^https?://.*\.jpg$', |
2bcae58d | 21 | }, |
1fc0b47f | 22 | 'skip': 'no longer available', |
23 | }, { | |
24 | 'url': 'http://sr-mediathek.sr-online.de/index.php?seite=7&id=37682', | |
25 | 'info_dict': { | |
26 | 'id': '37682', | |
27 | 'ext': 'mp4', | |
28 | 'title': 'Love, Cakes and Rock\'n\'Roll', | |
29 | 'description': 'md5:18bf9763631c7d326c22603681e1123d', | |
30 | }, | |
31 | 'params': { | |
32 | # m3u8 download | |
33 | 'skip_download': True, | |
34 | }, | |
8cc9b401 RA |
35 | }, { |
36 | 'url': 'http://sr-mediathek.de/index.php?seite=7&id=7480', | |
37 | 'only_matching': True, | |
1fc0b47f | 38 | }] |
2bcae58d PH |
39 | |
40 | def _real_extract(self, url): | |
41 | video_id = self._match_id(url) | |
42 | webpage = self._download_webpage(url, video_id) | |
43 | ||
1fc0b47f | 44 | if '>Der gewünschte Beitrag ist leider nicht mehr verfügbar.<' in webpage: |
45 | raise ExtractorError('Video %s is no longer available' % video_id, expected=True) | |
2bcae58d | 46 | |
1fc0b47f | 47 | media_collection_url = self._search_regex( |
48 | r'data-mediacollection-ardplayer="([^"]+)"', webpage, 'media collection url') | |
49 | info = self._extract_media_info(media_collection_url, webpage, video_id) | |
50 | info.update({ | |
2bcae58d | 51 | 'id': video_id, |
1fc0b47f | 52 | 'title': get_element_by_attribute('class', 'ardplayer-title', webpage), |
2bcae58d PH |
53 | 'description': self._og_search_description(webpage), |
54 | 'thumbnail': self._og_search_thumbnail(webpage), | |
1fc0b47f | 55 | }) |
56 | return info |