From 17e72d40a504cd940a7fcb2f894e94a8a7934977 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Tue, 1 Sep 2026 12:21:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=99=8E=E7=89=99=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8WSS=E8=87=AA=E5=AE=9A=E4=B9=89=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/huya/wss_client.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/huya/wss_client.py b/core/huya/wss_client.py index a1ee295..e88f3d5 100644 --- a/core/huya/wss_client.py +++ b/core/huya/wss_client.py @@ -214,7 +214,11 @@ class HuyaWssClient: } async def connect( - self, host: str = SHOP_WS_HOST, timeout: float = 15.0, cookie: str = "" + self, + host: str = SHOP_WS_HOST, + timeout: float = 15.0, + cookie: str = "", + origin: str = "https://m-shop.yaoguo.com", ): from urllib.parse import quote @@ -233,7 +237,7 @@ class HuyaWssClient: self.ws = await asyncio.wait_for( websockets.connect( url, - origin=cast(Any, "https://m-shop.yaoguo.com"), + origin=cast(Any, origin), user_agent_header=BROWSER_UA, additional_headers=headers, open_timeout=timeout,