From 363850009ed2719e045ac793194bbe6080efe667 Mon Sep 17 00:00:00 2001 From: hh0rva1h Date: Thu, 23 Apr 2020 20:04:16 +0200 Subject: [PATCH 1/9] Add ORF Radio Stations --- youtube_dl/extractor/extractors.py | 9 +++ youtube_dl/extractor/orf.py | 95 +++++++++++++++++++++++++++++- 2 files changed, 102 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index e407ab3d9..4acb003a9 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -804,6 +804,15 @@ from .orf import ( ORFFM4IE, ORFFM4StoryIE, ORFOE1IE, + ORFNOEIE, + ORFWIEIE, + ORFBGLIE, + ORFOOEIE, + ORFSTMIE, + ORFKTNIE, + ORFSBGIE, + ORFTIRIE, + ORFVBGIE, ORFIPTVIE, ) from .outsidetv import OutsideTVIE diff --git a/youtube_dl/extractor/orf.py b/youtube_dl/extractor/orf.py index d54b8ace6..2a0bf3f69 100644 --- a/youtube_dl/extractor/orf.py +++ b/youtube_dl/extractor/orf.py @@ -166,9 +166,40 @@ class ORFRadioIE(InfoExtractor): show_date = mobj.group('date') show_id = mobj.group('show') + if station == "noe": + loop_station = "oe2n" + api_station = "noe" + elif station == "wien": + api_station = "wie" + loop_station = "oe2w" + elif station == "burgenland": + api_station = "bgl" + loop_station = "oe2b" + elif station == "ooe": + api_station = "ooe" + loop_station = "oe2o" + elif station == "steiermark": + api_station = "stm" + loop_station = "oe2st" + elif station == "kaernten": + api_station = "ktn" + loop_station = "oe2k" + elif station == "salzburg": + api_station = "sbg" + loop_station = "oe2s" + elif station == "tirol": + api_station = "tir" + loop_station = "oe2t" + elif station == "vorarlberg": + api_station = "vbg" + loop_station = "oe2v" + else: + loop_station = station + api_station = station + data = self._download_json( 'http://audioapi.orf.at/%s/api/json/current/broadcast/%s/%s' - % (station, show_id, show_date), show_id) + % (api_station, show_id, show_date), show_id) entries = [] for info in data['streams']: @@ -183,7 +214,7 @@ class ORFRadioIE(InfoExtractor): duration = end - start if end and start else None entries.append({ 'id': loop_stream_id.replace('.mp3', ''), - 'url': 'http://loopstream01.apa.at/?channel=%s&id=%s' % (station, loop_stream_id), + 'url': 'http://loopstream01.apa.at/?channel=%s&id=%s' % (loop_station, loop_stream_id), 'title': title, 'description': clean_html(data.get('subtitle')), 'duration': duration, @@ -223,6 +254,66 @@ class ORFFM4IE(ORFRadioIE): } +class ORFNOEIE(ORFRadioIE): + IE_NAME = 'orf:noe' + IE_DESC = 'Radio Niederösterreich' + _VALID_URL = r'https?://(?Pnoe)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + + +class ORFWIEIE(ORFRadioIE): + IE_NAME = 'orf:wien' + IE_DESC = 'Radio Wien' + _VALID_URL = r'https?://(?Pwien)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + + +class ORFBGLIE(ORFRadioIE): + IE_NAME = 'orf:burgenland' + IE_DESC = 'Radio Burgenland' + _VALID_URL = r'https?://(?Pburgenland)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + + +class ORFOOEIE(ORFRadioIE): + IE_NAME = 'orf:oberoesterreich' + IE_DESC = 'Radio Oberösterreich' + _VALID_URL = r'https?://(?Pooe)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + + +class ORFSTMIE(ORFRadioIE): + IE_NAME = 'orf:steiermark' + IE_DESC = 'Radio Steiermark' + _VALID_URL = r'https?://(?Psteiermark)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + + +class ORFKTNIE(ORFRadioIE): + IE_NAME = 'orf:kaernten' + IE_DESC = 'Radio Kärnten' + _VALID_URL = r'https?://(?Pkaernten)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + + +class ORFSBGIE(ORFRadioIE): + IE_NAME = 'orf:salzburg' + IE_DESC = 'Radio Salzburg' + _VALID_URL = r'https?://(?Psalzburg)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + + +class ORFTRLIE(ORFRadioIE): + IE_NAME = 'orf:salzburg' + IE_DESC = 'Radio Salzburg' + _VALID_URL = r'https?://(?Psalzburg)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + + +class ORFTIRIE(ORFRadioIE): + IE_NAME = 'orf:tirol' + IE_DESC = 'Radio Tirol' + _VALID_URL = r'https?://(?Ptirol)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + + +class ORFVBGIE(ORFRadioIE): + IE_NAME = 'orf:vorarlberg' + IE_DESC = 'Radio Vorarlberg' + _VALID_URL = r'https?://(?Pvorarlberg)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + + class ORFOE1IE(ORFRadioIE): IE_NAME = 'orf:oe1' IE_DESC = 'Radio Österreich 1' From 8294dc20af5f159fc646d31af74e989a961e3ede Mon Sep 17 00:00:00 2001 From: hh0rva1h Date: Thu, 23 Apr 2020 22:05:33 +0200 Subject: [PATCH 2/9] orf extractor: implement change requests --- youtube_dl/extractor/orf.py | 69 +++++++++++++++---------------------- 1 file changed, 27 insertions(+), 42 deletions(-) diff --git a/youtube_dl/extractor/orf.py b/youtube_dl/extractor/orf.py index 2a0bf3f69..e4622a22f 100644 --- a/youtube_dl/extractor/orf.py +++ b/youtube_dl/extractor/orf.py @@ -166,40 +166,9 @@ class ORFRadioIE(InfoExtractor): show_date = mobj.group('date') show_id = mobj.group('show') - if station == "noe": - loop_station = "oe2n" - api_station = "noe" - elif station == "wien": - api_station = "wie" - loop_station = "oe2w" - elif station == "burgenland": - api_station = "bgl" - loop_station = "oe2b" - elif station == "ooe": - api_station = "ooe" - loop_station = "oe2o" - elif station == "steiermark": - api_station = "stm" - loop_station = "oe2st" - elif station == "kaernten": - api_station = "ktn" - loop_station = "oe2k" - elif station == "salzburg": - api_station = "sbg" - loop_station = "oe2s" - elif station == "tirol": - api_station = "tir" - loop_station = "oe2t" - elif station == "vorarlberg": - api_station = "vbg" - loop_station = "oe2v" - else: - loop_station = station - api_station = station - data = self._download_json( 'http://audioapi.orf.at/%s/api/json/current/broadcast/%s/%s' - % (api_station, show_id, show_date), show_id) + % (self.api_station, show_id, show_date), show_id) entries = [] for info in data['streams']: @@ -214,7 +183,7 @@ class ORFRadioIE(InfoExtractor): duration = end - start if end and start else None entries.append({ 'id': loop_stream_id.replace('.mp3', ''), - 'url': 'http://loopstream01.apa.at/?channel=%s&id=%s' % (loop_station, loop_stream_id), + 'url': 'http://loopstream01.apa.at/?channel=%s&id=%s' % (self.loop_station, loop_stream_id), 'title': title, 'description': clean_html(data.get('subtitle')), 'duration': duration, @@ -236,6 +205,8 @@ class ORFFM4IE(ORFRadioIE): IE_NAME = 'orf:fm4' IE_DESC = 'radio FM4' _VALID_URL = r'https?://(?Pfm4)\.orf\.at/player/(?P[0-9]+)/(?P4\w+)' + api_station = "fm4" + loop_station = "fm4" _TEST = { 'url': 'http://fm4.orf.at/player/20170107/4CC', @@ -258,66 +229,80 @@ class ORFNOEIE(ORFRadioIE): IE_NAME = 'orf:noe' IE_DESC = 'Radio Niederösterreich' _VALID_URL = r'https?://(?Pnoe)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + api_station = "noe" + loop_station = "oe2n" class ORFWIEIE(ORFRadioIE): IE_NAME = 'orf:wien' IE_DESC = 'Radio Wien' _VALID_URL = r'https?://(?Pwien)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + api_station = "wie" + loop_station = "oe2w" class ORFBGLIE(ORFRadioIE): IE_NAME = 'orf:burgenland' IE_DESC = 'Radio Burgenland' _VALID_URL = r'https?://(?Pburgenland)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + api_station = "bgl" + loop_station = "oe2b" class ORFOOEIE(ORFRadioIE): IE_NAME = 'orf:oberoesterreich' IE_DESC = 'Radio Oberösterreich' _VALID_URL = r'https?://(?Pooe)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + api_station = "ooe" + loop_station = "oe2o" class ORFSTMIE(ORFRadioIE): IE_NAME = 'orf:steiermark' IE_DESC = 'Radio Steiermark' _VALID_URL = r'https?://(?Psteiermark)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + api_station = "stm" + loop_station = "oe2st" class ORFKTNIE(ORFRadioIE): IE_NAME = 'orf:kaernten' IE_DESC = 'Radio Kärnten' _VALID_URL = r'https?://(?Pkaernten)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + api_station = "ktn" + loop_station = "oe2k" class ORFSBGIE(ORFRadioIE): IE_NAME = 'orf:salzburg' IE_DESC = 'Radio Salzburg' _VALID_URL = r'https?://(?Psalzburg)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' - - -class ORFTRLIE(ORFRadioIE): - IE_NAME = 'orf:salzburg' - IE_DESC = 'Radio Salzburg' - _VALID_URL = r'https?://(?Psalzburg)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + api_station = "sbg" + loop_station = "oe2s" class ORFTIRIE(ORFRadioIE): - IE_NAME = 'orf:tirol' - IE_DESC = 'Radio Tirol' - _VALID_URL = r'https?://(?Ptirol)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + IE_NAME = 'orf:salzburg' + IE_DESC = 'Radio Salzburg' + _VALID_URL = r'https?://(?Psalzburg)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + api_station = "tir" + loop_station = "oe2t" class ORFVBGIE(ORFRadioIE): IE_NAME = 'orf:vorarlberg' IE_DESC = 'Radio Vorarlberg' _VALID_URL = r'https?://(?Pvorarlberg)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + api_station = "vbg" + loop_station = "oe2v" class ORFOE1IE(ORFRadioIE): IE_NAME = 'orf:oe1' IE_DESC = 'Radio Österreich 1' _VALID_URL = r'https?://(?Poe1)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + api_station = "oe1" + loop_station = "oe2v" _TEST = { 'url': 'http://oe1.orf.at/player/20170108/456544', From e385631b0f38ec7ffbd9896e668ca3347799c721 Mon Sep 17 00:00:00 2001 From: hh0rva1h Date: Thu, 23 Apr 2020 22:13:19 +0200 Subject: [PATCH 3/9] orf: fix typos and add tests --- youtube_dl/extractor/orf.py | 48 +++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/orf.py b/youtube_dl/extractor/orf.py index e4622a22f..ef265d42e 100644 --- a/youtube_dl/extractor/orf.py +++ b/youtube_dl/extractor/orf.py @@ -232,6 +232,10 @@ class ORFNOEIE(ORFRadioIE): api_station = "noe" loop_station = "oe2n" + _TEST = { + 'url': 'https://noe.orf.at/player/20200423/NGM', + 'only_matching': True, + } class ORFWIEIE(ORFRadioIE): IE_NAME = 'orf:wien' @@ -240,6 +244,11 @@ class ORFWIEIE(ORFRadioIE): api_station = "wie" loop_station = "oe2w" + _TEST = { + 'url': 'https://wien.orf.at/player/20200423/WGUM', + 'only_matching': True, + } + class ORFBGLIE(ORFRadioIE): IE_NAME = 'orf:burgenland' @@ -248,6 +257,11 @@ class ORFBGLIE(ORFRadioIE): api_station = "bgl" loop_station = "oe2b" + _TEST = { + 'url': 'https://burgenland.orf.at/player/20200423/BGM', + 'only_matching': True, + } + class ORFOOEIE(ORFRadioIE): IE_NAME = 'orf:oberoesterreich' @@ -256,6 +270,11 @@ class ORFOOEIE(ORFRadioIE): api_station = "ooe" loop_station = "oe2o" + _TEST = { + 'url': 'https://ooe.orf.at/player/20200423/OGMO', + 'only_matching': True, + } + class ORFSTMIE(ORFRadioIE): IE_NAME = 'orf:steiermark' @@ -264,6 +283,11 @@ class ORFSTMIE(ORFRadioIE): api_station = "stm" loop_station = "oe2st" + _TEST = { + 'url': 'https://steiermark.orf.at/player/20200423/STGMS', + 'only_matching': True, + } + class ORFKTNIE(ORFRadioIE): IE_NAME = 'orf:kaernten' @@ -272,6 +296,11 @@ class ORFKTNIE(ORFRadioIE): api_station = "ktn" loop_station = "oe2k" + _TEST = { + 'url': 'https://kaernten.orf.at/player/20200423/KGUMO', + 'only_matching': True, + } + class ORFSBGIE(ORFRadioIE): IE_NAME = 'orf:salzburg' @@ -280,14 +309,24 @@ class ORFSBGIE(ORFRadioIE): api_station = "sbg" loop_station = "oe2s" + _TEST = { + 'url': 'https://salzburg.orf.at/player/20200423/SGUM', + 'only_matching': True, + } + class ORFTIRIE(ORFRadioIE): - IE_NAME = 'orf:salzburg' - IE_DESC = 'Radio Salzburg' + IE_NAME = 'orf:tirol' + IE_DESC = 'Radio Tirol' _VALID_URL = r'https?://(?Psalzburg)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' api_station = "tir" loop_station = "oe2t" + _TEST = { + 'url': 'https://tirol.orf.at/player/20200423/TGUMO', + 'only_matching': True, + } + class ORFVBGIE(ORFRadioIE): IE_NAME = 'orf:vorarlberg' @@ -296,6 +335,11 @@ class ORFVBGIE(ORFRadioIE): api_station = "vbg" loop_station = "oe2v" + _TEST = { + 'url': 'https://vorarlberg.orf.at/player/20200423/VGUM', + 'only_matching': True, + } + class ORFOE1IE(ORFRadioIE): IE_NAME = 'orf:oe1' From c9ddb997f856b2ee832f39856e66f6c797a13ab9 Mon Sep 17 00:00:00 2001 From: hh0rva1h Date: Thu, 23 Apr 2020 22:26:45 +0200 Subject: [PATCH 4/9] orf: reduce tests to only_matching --- youtube_dl/extractor/orf.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/youtube_dl/extractor/orf.py b/youtube_dl/extractor/orf.py index ef265d42e..8cf0a76b8 100644 --- a/youtube_dl/extractor/orf.py +++ b/youtube_dl/extractor/orf.py @@ -233,7 +233,6 @@ class ORFNOEIE(ORFRadioIE): loop_station = "oe2n" _TEST = { - 'url': 'https://noe.orf.at/player/20200423/NGM', 'only_matching': True, } @@ -245,7 +244,6 @@ class ORFWIEIE(ORFRadioIE): loop_station = "oe2w" _TEST = { - 'url': 'https://wien.orf.at/player/20200423/WGUM', 'only_matching': True, } @@ -258,7 +256,6 @@ class ORFBGLIE(ORFRadioIE): loop_station = "oe2b" _TEST = { - 'url': 'https://burgenland.orf.at/player/20200423/BGM', 'only_matching': True, } @@ -271,7 +268,6 @@ class ORFOOEIE(ORFRadioIE): loop_station = "oe2o" _TEST = { - 'url': 'https://ooe.orf.at/player/20200423/OGMO', 'only_matching': True, } @@ -284,7 +280,6 @@ class ORFSTMIE(ORFRadioIE): loop_station = "oe2st" _TEST = { - 'url': 'https://steiermark.orf.at/player/20200423/STGMS', 'only_matching': True, } @@ -297,7 +292,6 @@ class ORFKTNIE(ORFRadioIE): loop_station = "oe2k" _TEST = { - 'url': 'https://kaernten.orf.at/player/20200423/KGUMO', 'only_matching': True, } @@ -310,7 +304,6 @@ class ORFSBGIE(ORFRadioIE): loop_station = "oe2s" _TEST = { - 'url': 'https://salzburg.orf.at/player/20200423/SGUM', 'only_matching': True, } @@ -323,7 +316,6 @@ class ORFTIRIE(ORFRadioIE): loop_station = "oe2t" _TEST = { - 'url': 'https://tirol.orf.at/player/20200423/TGUMO', 'only_matching': True, } @@ -336,7 +328,6 @@ class ORFVBGIE(ORFRadioIE): loop_station = "oe2v" _TEST = { - 'url': 'https://vorarlberg.orf.at/player/20200423/VGUM', 'only_matching': True, } From 1d8f34a30f9fbf939543e72b94dc91da39ba0bcf Mon Sep 17 00:00:00 2001 From: hh0rva1h Date: Fri, 24 Apr 2020 09:33:37 +0200 Subject: [PATCH 5/9] orf: Fix typo and flake8 errors --- youtube_dl/extractor/orf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/orf.py b/youtube_dl/extractor/orf.py index 8cf0a76b8..537c3faa0 100644 --- a/youtube_dl/extractor/orf.py +++ b/youtube_dl/extractor/orf.py @@ -162,7 +162,6 @@ class ORFTVthekIE(InfoExtractor): class ORFRadioIE(InfoExtractor): def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) - station = mobj.group('station') show_date = mobj.group('date') show_id = mobj.group('show') @@ -236,6 +235,7 @@ class ORFNOEIE(ORFRadioIE): 'only_matching': True, } + class ORFWIEIE(ORFRadioIE): IE_NAME = 'orf:wien' IE_DESC = 'Radio Wien' @@ -311,7 +311,7 @@ class ORFSBGIE(ORFRadioIE): class ORFTIRIE(ORFRadioIE): IE_NAME = 'orf:tirol' IE_DESC = 'Radio Tirol' - _VALID_URL = r'https?://(?Psalzburg)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + _VALID_URL = r'https?://(?Ptirol)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' api_station = "tir" loop_station = "oe2t" From 9b02ce0e86a8e5b2edf84f7d99fc0e0c177f1953 Mon Sep 17 00:00:00 2001 From: hh0rva1h Date: Fri, 24 Apr 2020 09:33:40 +0200 Subject: [PATCH 6/9] Revert "orf: reduce tests to only_matching" This reverts commit c9ddb997f856b2ee832f39856e66f6c797a13ab9. --- youtube_dl/extractor/orf.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/youtube_dl/extractor/orf.py b/youtube_dl/extractor/orf.py index 537c3faa0..384d9c876 100644 --- a/youtube_dl/extractor/orf.py +++ b/youtube_dl/extractor/orf.py @@ -232,6 +232,7 @@ class ORFNOEIE(ORFRadioIE): loop_station = "oe2n" _TEST = { + 'url': 'https://noe.orf.at/player/20200423/NGM', 'only_matching': True, } @@ -244,6 +245,7 @@ class ORFWIEIE(ORFRadioIE): loop_station = "oe2w" _TEST = { + 'url': 'https://wien.orf.at/player/20200423/WGUM', 'only_matching': True, } @@ -256,6 +258,7 @@ class ORFBGLIE(ORFRadioIE): loop_station = "oe2b" _TEST = { + 'url': 'https://burgenland.orf.at/player/20200423/BGM', 'only_matching': True, } @@ -268,6 +271,7 @@ class ORFOOEIE(ORFRadioIE): loop_station = "oe2o" _TEST = { + 'url': 'https://ooe.orf.at/player/20200423/OGMO', 'only_matching': True, } @@ -280,6 +284,7 @@ class ORFSTMIE(ORFRadioIE): loop_station = "oe2st" _TEST = { + 'url': 'https://steiermark.orf.at/player/20200423/STGMS', 'only_matching': True, } @@ -292,6 +297,7 @@ class ORFKTNIE(ORFRadioIE): loop_station = "oe2k" _TEST = { + 'url': 'https://kaernten.orf.at/player/20200423/KGUMO', 'only_matching': True, } @@ -304,6 +310,7 @@ class ORFSBGIE(ORFRadioIE): loop_station = "oe2s" _TEST = { + 'url': 'https://salzburg.orf.at/player/20200423/SGUM', 'only_matching': True, } @@ -316,6 +323,7 @@ class ORFTIRIE(ORFRadioIE): loop_station = "oe2t" _TEST = { + 'url': 'https://tirol.orf.at/player/20200423/TGUMO', 'only_matching': True, } @@ -328,6 +336,7 @@ class ORFVBGIE(ORFRadioIE): loop_station = "oe2v" _TEST = { + 'url': 'https://vorarlberg.orf.at/player/20200423/VGUM', 'only_matching': True, } From 6a3f8e5ee0cf97276dedf794c02fcfa8aff857be Mon Sep 17 00:00:00 2001 From: hh0rva1h Date: Fri, 24 Apr 2020 10:21:49 +0200 Subject: [PATCH 7/9] =?UTF-8?q?orf:=20Add=20=C3=963=20radio=20station?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/orf.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 4acb003a9..4b3092028 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -804,6 +804,7 @@ from .orf import ( ORFFM4IE, ORFFM4StoryIE, ORFOE1IE, + ORFOE3IE, ORFNOEIE, ORFWIEIE, ORFBGLIE, diff --git a/youtube_dl/extractor/orf.py b/youtube_dl/extractor/orf.py index 384d9c876..5f8960156 100644 --- a/youtube_dl/extractor/orf.py +++ b/youtube_dl/extractor/orf.py @@ -341,6 +341,19 @@ class ORFVBGIE(ORFRadioIE): } +class ORFOE3IE(ORFRadioIE): + IE_NAME = 'orf:oe3' + IE_DESC = 'Radio Österreich 3' + _VALID_URL = r'https?://(?Poe3)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' + api_station = "oe3" + loop_station = "oe3" + + _TEST = { + 'url': 'https://oe3.orf.at/player/20200424/3WEK', + 'only_matching': True, + } + + class ORFOE1IE(ORFRadioIE): IE_NAME = 'orf:oe1' IE_DESC = 'Radio Österreich 1' From 9af637ecc0dcb67dece953aa6464d3637295d8a4 Mon Sep 17 00:00:00 2001 From: hh0rva1h Date: Fri, 24 Apr 2020 14:35:40 +0200 Subject: [PATCH 8/9] orf: fix typo --- youtube_dl/extractor/orf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/orf.py b/youtube_dl/extractor/orf.py index 5f8960156..71da432c9 100644 --- a/youtube_dl/extractor/orf.py +++ b/youtube_dl/extractor/orf.py @@ -359,7 +359,7 @@ class ORFOE1IE(ORFRadioIE): IE_DESC = 'Radio Österreich 1' _VALID_URL = r'https?://(?Poe1)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' api_station = "oe1" - loop_station = "oe2v" + loop_station = "oe1" _TEST = { 'url': 'http://oe1.orf.at/player/20170108/456544', From 5252520cc4c6b6655ccfa3967232df0cbfd311f1 Mon Sep 17 00:00:00 2001 From: hh0rva1h Date: Sat, 2 May 2020 22:04:59 +0200 Subject: [PATCH 9/9] orf.py: Coding conventions --- youtube_dl/extractor/orf.py | 52 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/youtube_dl/extractor/orf.py b/youtube_dl/extractor/orf.py index 71da432c9..700ce448c 100644 --- a/youtube_dl/extractor/orf.py +++ b/youtube_dl/extractor/orf.py @@ -167,7 +167,7 @@ class ORFRadioIE(InfoExtractor): data = self._download_json( '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 = [] for info in data['streams']: @@ -182,7 +182,7 @@ class ORFRadioIE(InfoExtractor): duration = end - start if end and start else None entries.append({ '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, 'description': clean_html(data.get('subtitle')), 'duration': duration, @@ -204,8 +204,8 @@ class ORFFM4IE(ORFRadioIE): IE_NAME = 'orf:fm4' IE_DESC = 'radio FM4' _VALID_URL = r'https?://(?Pfm4)\.orf\.at/player/(?P[0-9]+)/(?P4\w+)' - api_station = "fm4" - loop_station = "fm4" + _API_STATION = 'fm4' + _LOOP_STATION = 'fm4' _TEST = { 'url': 'http://fm4.orf.at/player/20170107/4CC', @@ -228,8 +228,8 @@ class ORFNOEIE(ORFRadioIE): IE_NAME = 'orf:noe' IE_DESC = 'Radio Niederösterreich' _VALID_URL = r'https?://(?Pnoe)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' - api_station = "noe" - loop_station = "oe2n" + _API_STATION = 'noe' + _LOOP_STATION = 'oe2n' _TEST = { 'url': 'https://noe.orf.at/player/20200423/NGM', @@ -241,8 +241,8 @@ class ORFWIEIE(ORFRadioIE): IE_NAME = 'orf:wien' IE_DESC = 'Radio Wien' _VALID_URL = r'https?://(?Pwien)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' - api_station = "wie" - loop_station = "oe2w" + _API_STATION = 'wie' + _LOOP_STATION = 'oe2w' _TEST = { 'url': 'https://wien.orf.at/player/20200423/WGUM', @@ -254,8 +254,8 @@ class ORFBGLIE(ORFRadioIE): IE_NAME = 'orf:burgenland' IE_DESC = 'Radio Burgenland' _VALID_URL = r'https?://(?Pburgenland)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' - api_station = "bgl" - loop_station = "oe2b" + _API_STATION = 'bgl' + _LOOP_STATION = 'oe2b' _TEST = { 'url': 'https://burgenland.orf.at/player/20200423/BGM', @@ -267,8 +267,8 @@ class ORFOOEIE(ORFRadioIE): IE_NAME = 'orf:oberoesterreich' IE_DESC = 'Radio Oberösterreich' _VALID_URL = r'https?://(?Pooe)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' - api_station = "ooe" - loop_station = "oe2o" + _API_STATION = 'ooe' + _LOOP_STATION = 'oe2o' _TEST = { 'url': 'https://ooe.orf.at/player/20200423/OGMO', @@ -280,8 +280,8 @@ class ORFSTMIE(ORFRadioIE): IE_NAME = 'orf:steiermark' IE_DESC = 'Radio Steiermark' _VALID_URL = r'https?://(?Psteiermark)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' - api_station = "stm" - loop_station = "oe2st" + _API_STATION = 'stm' + _LOOP_STATION = 'oe2st' _TEST = { 'url': 'https://steiermark.orf.at/player/20200423/STGMS', @@ -293,8 +293,8 @@ class ORFKTNIE(ORFRadioIE): IE_NAME = 'orf:kaernten' IE_DESC = 'Radio Kärnten' _VALID_URL = r'https?://(?Pkaernten)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' - api_station = "ktn" - loop_station = "oe2k" + _API_STATION = 'ktn' + _LOOP_STATION = 'oe2k' _TEST = { 'url': 'https://kaernten.orf.at/player/20200423/KGUMO', @@ -306,8 +306,8 @@ class ORFSBGIE(ORFRadioIE): IE_NAME = 'orf:salzburg' IE_DESC = 'Radio Salzburg' _VALID_URL = r'https?://(?Psalzburg)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' - api_station = "sbg" - loop_station = "oe2s" + _API_STATION = 'sbg' + _LOOP_STATION = 'oe2s' _TEST = { 'url': 'https://salzburg.orf.at/player/20200423/SGUM', @@ -319,8 +319,8 @@ class ORFTIRIE(ORFRadioIE): IE_NAME = 'orf:tirol' IE_DESC = 'Radio Tirol' _VALID_URL = r'https?://(?Ptirol)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' - api_station = "tir" - loop_station = "oe2t" + _API_STATION = 'tir' + _LOOP_STATION = 'oe2t' _TEST = { 'url': 'https://tirol.orf.at/player/20200423/TGUMO', @@ -332,8 +332,8 @@ class ORFVBGIE(ORFRadioIE): IE_NAME = 'orf:vorarlberg' IE_DESC = 'Radio Vorarlberg' _VALID_URL = r'https?://(?Pvorarlberg)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' - api_station = "vbg" - loop_station = "oe2v" + _API_STATION = 'vbg' + _LOOP_STATION = 'oe2v' _TEST = { 'url': 'https://vorarlberg.orf.at/player/20200423/VGUM', @@ -345,8 +345,8 @@ class ORFOE3IE(ORFRadioIE): IE_NAME = 'orf:oe3' IE_DESC = 'Radio Österreich 3' _VALID_URL = r'https?://(?Poe3)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' - api_station = "oe3" - loop_station = "oe3" + _API_STATION = 'oe3' + _LOOP_STATION = 'oe3' _TEST = { 'url': 'https://oe3.orf.at/player/20200424/3WEK', @@ -358,8 +358,8 @@ class ORFOE1IE(ORFRadioIE): IE_NAME = 'orf:oe1' IE_DESC = 'Radio Österreich 1' _VALID_URL = r'https?://(?Poe1)\.orf\.at/player/(?P[0-9]+)/(?P\w+)' - api_station = "oe1" - loop_station = "oe1" + _API_STATION = 'oe1' + _LOOP_STATION = 'oe1' _TEST = { 'url': 'http://oe1.orf.at/player/20170108/456544',