diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 4b3092028..efefd5328 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -814,6 +814,7 @@ from .orf import ( ORFSBGIE, ORFTIRIE, ORFVBGIE, + ORFRadiothekIE, ORFIPTVIE, ) from .outsidetv import OutsideTVIE diff --git a/youtube_dl/extractor/orf.py b/youtube_dl/extractor/orf.py index 700ce448c..fc58e2863 100644 --- a/youtube_dl/extractor/orf.py +++ b/youtube_dl/extractor/orf.py @@ -376,6 +376,38 @@ class ORFOE1IE(ORFRadioIE): } +class ORFRadiothekIE(ORFRadioIE): + _VALID_URL = r'https?://radiothek\.orf\.at/(?P\w+)/(?P[0-9]+)/(?P\w+)' + IE_NAME = 'orf:radiothek' + IE_DESC = 'ORF Radiothek' + + _API_LOOP_MAP = { + 'fm4': 'fm4', + 'noe': 'oe2n', + 'wie': 'oe2w', + 'bgl': 'oe2b', + 'ooe': 'oe2o', + 'stm': 'oe2st', + 'ktn': 'oe2k', + 'sbg': 'oe2s', + 'tir': 'oe2t', + 'vbg': 'oe2v', + 'oe3': 'oe3', + 'oe1': 'oe1', + } + + _TEST = { + 'url': 'https://radiothek.orf.at/fm4/20200513/4UL', + 'only_matching': True, + } + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + self._API_STATION = mobj.group('station') + self._LOOP_STATION = self._API_LOOP_MAP[mobj.group('station')] + return super(ORFRadiothekIE, self)._real_extract(url) + + class ORFIPTVIE(InfoExtractor): IE_NAME = 'orf:iptv' IE_DESC = 'iptv.ORF.at'