1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-14 07:57:15 +08:00

[orf] move _VALID_URLs of radios into each child class.

This commit is contained in:
phaer 2017-05-11 01:46:28 +02:00
parent 3126ad38d7
commit 4e0f9a05d8

View File

@ -143,38 +143,6 @@ class ORFTVthekIE(InfoExtractor):
class ORFRadioIE(InfoExtractor):
_VALID_URL = r'https?://(?P<station>oe1|fm4)\.orf\.at/(?:7tage/?#|player/)(?P<date>[0-9]+)/(?P<show>\w+)'
_TESTS = [
{
'url': 'http://fm4.orf.at/player/20170107/CC',
'md5': '2b0be47375432a7ef104453432a19212',
'info_dict': {
'id': '2017-01-07_2100_tl_54_7DaysSat18_31295',
'ext': 'mp3',
'title': 'Solid Steel Radioshow',
'description': 'Die Mixshow von Coldcut und Ninja Tune.',
'duration': 3599,
'timestamp': 1483819257,
'upload_date': '20170107',
},
'skip': 'Shows from ORF radios are only available for 7 days.'
},
{
'url': 'http://oe1.orf.at/player/20170108/456544',
'md5': '34d8a6e67ea888293741c86a099b745b',
'info_dict': {
'id': '2017-01-08_0759_tl_51_7DaysSun6_256141',
'ext': 'mp3',
'title': 'Morgenjournal',
'duration': 609,
'timestamp': 1483858796,
'upload_date': '20170108',
},
'skip': 'Shows from ORF radios are only available for 7 days.'
}
]
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
station = mobj.group('station')
@ -214,11 +182,46 @@ class ORFRadioIE(InfoExtractor):
class ORFFM4IE(ORFRadioIE):
IE_NAME = 'orf:fm4'
IE_DESC = 'radio FM4'
_VALID_URL = r'https?://(?P<station>fm4)\.orf\.at/(?:7tage/?#|player/)(?P<date>[0-9]+)/(?P<show>\w+)'
_TESTS = [
{
'url': 'http://fm4.orf.at/player/20170107/CC',
'md5': '2b0be47375432a7ef104453432a19212',
'info_dict': {
'id': '2017-01-07_2100_tl_54_7DaysSat18_31295',
'ext': 'mp3',
'title': 'Solid Steel Radioshow',
'description': 'Die Mixshow von Coldcut und Ninja Tune.',
'duration': 3599,
'timestamp': 1483819257,
'upload_date': '20170107',
},
'skip': 'Shows from ORF radios are only available for 7 days.'
}
]
class ORFOE1IE(ORFRadioIE):
IE_NAME = 'orf:oe1'
IE_DESC = 'Radio Österreich 1'
_VALID_URL = r'https?://(?P<station>oe1)\.orf\.at/(?:7tage/?#|player/)(?P<date>[0-9]+)/(?P<show>\w+)'
_TESTS = [
{
'url': 'http://oe1.orf.at/player/20170108/456544',
'md5': '34d8a6e67ea888293741c86a099b745b',
'info_dict': {
'id': '2017-01-08_0759_tl_51_7DaysSun6_256141',
'ext': 'mp3',
'title': 'Morgenjournal',
'duration': 609,
'timestamp': 1483858796,
'upload_date': '20170108',
},
'skip': 'Shows from ORF radios are only available for 7 days.'
}
]
class ORFIPTVIE(InfoExtractor):