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