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

orf.py: Coding conventions

This commit is contained in:
hh0rva1h 2020-05-02 22:04:59 +02:00
parent 9af637ecc0
commit 5252520cc4

View File

@ -167,7 +167,7 @@ class ORFRadioIE(InfoExtractor):
data = self._download_json( data = self._download_json(
'http://audioapi.orf.at/%s/api/json/current/broadcast/%s/%s' 'http://audioapi.orf.at/%s/api/json/current/broadcast/%s/%s'
% (self.api_station, show_id, show_date), show_id) % (self._API_STATION, show_id, show_date), show_id)
entries = [] entries = []
for info in data['streams']: for info in data['streams']:
@ -182,7 +182,7 @@ class ORFRadioIE(InfoExtractor):
duration = end - start if end and start else None duration = end - start if end and start else None
entries.append({ entries.append({
'id': loop_stream_id.replace('.mp3', ''), 'id': loop_stream_id.replace('.mp3', ''),
'url': 'http://loopstream01.apa.at/?channel=%s&id=%s' % (self.loop_station, loop_stream_id), 'url': 'http://loopstream01.apa.at/?channel=%s&id=%s' % (self._LOOP_STATION, loop_stream_id),
'title': title, 'title': title,
'description': clean_html(data.get('subtitle')), 'description': clean_html(data.get('subtitle')),
'duration': duration, 'duration': duration,
@ -204,8 +204,8 @@ class ORFFM4IE(ORFRadioIE):
IE_NAME = 'orf:fm4' IE_NAME = 'orf:fm4'
IE_DESC = 'radio FM4' IE_DESC = 'radio FM4'
_VALID_URL = r'https?://(?P<station>fm4)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>4\w+)' _VALID_URL = r'https?://(?P<station>fm4)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>4\w+)'
api_station = "fm4" _API_STATION = 'fm4'
loop_station = "fm4" _LOOP_STATION = 'fm4'
_TEST = { _TEST = {
'url': 'http://fm4.orf.at/player/20170107/4CC', 'url': 'http://fm4.orf.at/player/20170107/4CC',
@ -228,8 +228,8 @@ class ORFNOEIE(ORFRadioIE):
IE_NAME = 'orf:noe' IE_NAME = 'orf:noe'
IE_DESC = 'Radio Niederösterreich' IE_DESC = 'Radio Niederösterreich'
_VALID_URL = r'https?://(?P<station>noe)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)' _VALID_URL = r'https?://(?P<station>noe)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)'
api_station = "noe" _API_STATION = 'noe'
loop_station = "oe2n" _LOOP_STATION = 'oe2n'
_TEST = { _TEST = {
'url': 'https://noe.orf.at/player/20200423/NGM', 'url': 'https://noe.orf.at/player/20200423/NGM',
@ -241,8 +241,8 @@ class ORFWIEIE(ORFRadioIE):
IE_NAME = 'orf:wien' IE_NAME = 'orf:wien'
IE_DESC = 'Radio Wien' IE_DESC = 'Radio Wien'
_VALID_URL = r'https?://(?P<station>wien)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)' _VALID_URL = r'https?://(?P<station>wien)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)'
api_station = "wie" _API_STATION = 'wie'
loop_station = "oe2w" _LOOP_STATION = 'oe2w'
_TEST = { _TEST = {
'url': 'https://wien.orf.at/player/20200423/WGUM', 'url': 'https://wien.orf.at/player/20200423/WGUM',
@ -254,8 +254,8 @@ class ORFBGLIE(ORFRadioIE):
IE_NAME = 'orf:burgenland' IE_NAME = 'orf:burgenland'
IE_DESC = 'Radio Burgenland' IE_DESC = 'Radio Burgenland'
_VALID_URL = r'https?://(?P<station>burgenland)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)' _VALID_URL = r'https?://(?P<station>burgenland)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)'
api_station = "bgl" _API_STATION = 'bgl'
loop_station = "oe2b" _LOOP_STATION = 'oe2b'
_TEST = { _TEST = {
'url': 'https://burgenland.orf.at/player/20200423/BGM', 'url': 'https://burgenland.orf.at/player/20200423/BGM',
@ -267,8 +267,8 @@ class ORFOOEIE(ORFRadioIE):
IE_NAME = 'orf:oberoesterreich' IE_NAME = 'orf:oberoesterreich'
IE_DESC = 'Radio Oberösterreich' IE_DESC = 'Radio Oberösterreich'
_VALID_URL = r'https?://(?P<station>ooe)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)' _VALID_URL = r'https?://(?P<station>ooe)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)'
api_station = "ooe" _API_STATION = 'ooe'
loop_station = "oe2o" _LOOP_STATION = 'oe2o'
_TEST = { _TEST = {
'url': 'https://ooe.orf.at/player/20200423/OGMO', 'url': 'https://ooe.orf.at/player/20200423/OGMO',
@ -280,8 +280,8 @@ class ORFSTMIE(ORFRadioIE):
IE_NAME = 'orf:steiermark' IE_NAME = 'orf:steiermark'
IE_DESC = 'Radio Steiermark' IE_DESC = 'Radio Steiermark'
_VALID_URL = r'https?://(?P<station>steiermark)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)' _VALID_URL = r'https?://(?P<station>steiermark)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)'
api_station = "stm" _API_STATION = 'stm'
loop_station = "oe2st" _LOOP_STATION = 'oe2st'
_TEST = { _TEST = {
'url': 'https://steiermark.orf.at/player/20200423/STGMS', 'url': 'https://steiermark.orf.at/player/20200423/STGMS',
@ -293,8 +293,8 @@ class ORFKTNIE(ORFRadioIE):
IE_NAME = 'orf:kaernten' IE_NAME = 'orf:kaernten'
IE_DESC = 'Radio Kärnten' IE_DESC = 'Radio Kärnten'
_VALID_URL = r'https?://(?P<station>kaernten)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)' _VALID_URL = r'https?://(?P<station>kaernten)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)'
api_station = "ktn" _API_STATION = 'ktn'
loop_station = "oe2k" _LOOP_STATION = 'oe2k'
_TEST = { _TEST = {
'url': 'https://kaernten.orf.at/player/20200423/KGUMO', 'url': 'https://kaernten.orf.at/player/20200423/KGUMO',
@ -306,8 +306,8 @@ class ORFSBGIE(ORFRadioIE):
IE_NAME = 'orf:salzburg' IE_NAME = 'orf:salzburg'
IE_DESC = 'Radio Salzburg' IE_DESC = 'Radio Salzburg'
_VALID_URL = r'https?://(?P<station>salzburg)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)' _VALID_URL = r'https?://(?P<station>salzburg)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)'
api_station = "sbg" _API_STATION = 'sbg'
loop_station = "oe2s" _LOOP_STATION = 'oe2s'
_TEST = { _TEST = {
'url': 'https://salzburg.orf.at/player/20200423/SGUM', 'url': 'https://salzburg.orf.at/player/20200423/SGUM',
@ -319,8 +319,8 @@ class ORFTIRIE(ORFRadioIE):
IE_NAME = 'orf:tirol' IE_NAME = 'orf:tirol'
IE_DESC = 'Radio Tirol' IE_DESC = 'Radio Tirol'
_VALID_URL = r'https?://(?P<station>tirol)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)' _VALID_URL = r'https?://(?P<station>tirol)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)'
api_station = "tir" _API_STATION = 'tir'
loop_station = "oe2t" _LOOP_STATION = 'oe2t'
_TEST = { _TEST = {
'url': 'https://tirol.orf.at/player/20200423/TGUMO', 'url': 'https://tirol.orf.at/player/20200423/TGUMO',
@ -332,8 +332,8 @@ class ORFVBGIE(ORFRadioIE):
IE_NAME = 'orf:vorarlberg' IE_NAME = 'orf:vorarlberg'
IE_DESC = 'Radio Vorarlberg' IE_DESC = 'Radio Vorarlberg'
_VALID_URL = r'https?://(?P<station>vorarlberg)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)' _VALID_URL = r'https?://(?P<station>vorarlberg)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)'
api_station = "vbg" _API_STATION = 'vbg'
loop_station = "oe2v" _LOOP_STATION = 'oe2v'
_TEST = { _TEST = {
'url': 'https://vorarlberg.orf.at/player/20200423/VGUM', 'url': 'https://vorarlberg.orf.at/player/20200423/VGUM',
@ -345,8 +345,8 @@ class ORFOE3IE(ORFRadioIE):
IE_NAME = 'orf:oe3' IE_NAME = 'orf:oe3'
IE_DESC = 'Radio Österreich 3' IE_DESC = 'Radio Österreich 3'
_VALID_URL = r'https?://(?P<station>oe3)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)' _VALID_URL = r'https?://(?P<station>oe3)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)'
api_station = "oe3" _API_STATION = 'oe3'
loop_station = "oe3" _LOOP_STATION = 'oe3'
_TEST = { _TEST = {
'url': 'https://oe3.orf.at/player/20200424/3WEK', 'url': 'https://oe3.orf.at/player/20200424/3WEK',
@ -358,8 +358,8 @@ class ORFOE1IE(ORFRadioIE):
IE_NAME = 'orf:oe1' IE_NAME = 'orf:oe1'
IE_DESC = 'Radio Österreich 1' IE_DESC = 'Radio Österreich 1'
_VALID_URL = r'https?://(?P<station>oe1)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)' _VALID_URL = r'https?://(?P<station>oe1)\.orf\.at/player/(?P<date>[0-9]+)/(?P<show>\w+)'
api_station = "oe1" _API_STATION = 'oe1'
loop_station = "oe1" _LOOP_STATION = 'oe1'
_TEST = { _TEST = {
'url': 'http://oe1.orf.at/player/20170108/456544', 'url': 'http://oe1.orf.at/player/20170108/456544',