From 23adfa41c58834c27f6afe36b0d84eedcc868b99 Mon Sep 17 00:00:00 2001
From: c-basalt <117849907+c-basalt@users.noreply.github.com>
Date: Tue, 6 Aug 2024 11:05:27 -0400
Subject: [PATCH] prioritize hls

---
 src/streamlink/plugins/twitcasting.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/streamlink/plugins/twitcasting.py b/src/streamlink/plugins/twitcasting.py
index 258bfbcad97..b0f4d29bb21 100644
--- a/src/streamlink/plugins/twitcasting.py
+++ b/src/streamlink/plugins/twitcasting.py
@@ -137,10 +137,10 @@ def _get_streams(self):
         self.title = match_or_none(r'<meta\s+\bproperty="og:title"[^>]+\bcontent="([^"]+)"/>', webpage)
         self.author = match_or_none(r'<span class="tw-user-nav-name">([^<]+)', webpage)
 
-        if websocket:
-            yield from self._get_streams_websocket(websocket)
         if hls:
             yield from self._get_streams_hls(hls)
+        elif websocket:
+            yield from self._get_streams_websocket(websocket)
 
 
 class TwitCastingWsClient(WebsocketClient):