Skip to content

Commit d24bb93

Browse files
committed
plugins.telmadrid: add VOD URL to matcher tests, remove unnecessary dict() call, stop catching PluginError (for more detailed schema validation errors)
1 parent d226ced commit d24bb93

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/streamlink/plugins/telemadrid.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@
1818
class Telemadrid(Plugin):
1919

2020
def _get_streams(self):
21-
try:
22-
data = self.session.http.get(self.url, schema=validate.Schema(
23-
validate.parse_html(),
24-
validate.xml_find(".//video[@class='video-js'][@data-video-id][@data-account][@data-player][1]"),
25-
validate.union_get("data-video-id", "data-account", "data-player"),
26-
))
27-
except PluginError:
28-
return
21+
data = self.session.http.get(self.url, schema=validate.Schema(
22+
validate.parse_html(),
23+
validate.xml_find(".//video[@class='video-js'][@data-video-id][@data-account][@data-player][1]"),
24+
validate.union_get("data-video-id", "data-account", "data-player"),
25+
))
2926
data_video_id, data_account, data_player = data
3027
player = BrightcovePlayer(self.session, data_account, f"{data_player}_default")
31-
return dict(player.get_streams(data_video_id))
28+
return player.get_streams(data_video_id)
3229

3330

3431
__plugin__ = Telemadrid

tests/plugins/test_telemadrid.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ class TestPluginCanHandleUrlTelemadrid(PluginCanHandleUrl):
88
should_match = [
99
"https://www.telemadrid.es/",
1010
"https://www.telemadrid.es/emision-en-directo/",
11+
"https://www.telemadrid.es/programas/telenoticias-1/Telenoticias-1-02032023-2-2538066218--20230302042202.html",
1112
]

0 commit comments

Comments
 (0)