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,