支持虎牙活动WSS自定义连接来源
This commit is contained in:
@@ -214,7 +214,11 @@ class HuyaWssClient:
|
|||||||
}
|
}
|
||||||
|
|
||||||
async def connect(
|
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
|
from urllib.parse import quote
|
||||||
|
|
||||||
@@ -233,7 +237,7 @@ class HuyaWssClient:
|
|||||||
self.ws = await asyncio.wait_for(
|
self.ws = await asyncio.wait_for(
|
||||||
websockets.connect(
|
websockets.connect(
|
||||||
url,
|
url,
|
||||||
origin=cast(Any, "https://m-shop.yaoguo.com"),
|
origin=cast(Any, origin),
|
||||||
user_agent_header=BROWSER_UA,
|
user_agent_header=BROWSER_UA,
|
||||||
additional_headers=headers,
|
additional_headers=headers,
|
||||||
open_timeout=timeout,
|
open_timeout=timeout,
|
||||||
|
|||||||
Reference in New Issue
Block a user