统一推送前Python代码格式
This commit is contained in:
+53
-13
@@ -349,7 +349,11 @@ class HuyaHttpClient:
|
||||
# ---------- 业务便捷方法 ----------
|
||||
|
||||
def get_act_info(
|
||||
self, act_id: int, act_uuid: str = "", app_source: str = "", timeout: float = 15.0
|
||||
self,
|
||||
act_id: int,
|
||||
act_uuid: str = "",
|
||||
app_source: str = "",
|
||||
timeout: float = 15.0,
|
||||
):
|
||||
"""读取活动主信息,用于驱动当前活动配置。"""
|
||||
from .activity_structs import GetActInfoReq, GetActInfoResp
|
||||
@@ -358,7 +362,9 @@ class HuyaHttpClient:
|
||||
req.actId = int(act_id or 0)
|
||||
req.actUuid = act_uuid
|
||||
req.appSource = app_source
|
||||
return self.call_rpc("webActUI", "getActInfo", req, GetActInfoResp, timeout=timeout)
|
||||
return self.call_rpc(
|
||||
"webActUI", "getActInfo", req, GetActInfoResp, timeout=timeout
|
||||
)
|
||||
|
||||
def get_act_user_task_detail(
|
||||
self, uid: int, cookie: str, act_id: int, timeout: float = 15.0
|
||||
@@ -370,8 +376,13 @@ class HuyaHttpClient:
|
||||
req.userId = self._build_activity_user(uid, cookie)
|
||||
req.actId = int(act_id or 0)
|
||||
return self.call_rpc(
|
||||
"webActUI", "getActUserTaskDetail", req, GetActUserTaskDetailResp,
|
||||
uid=uid, cookie=cookie, timeout=timeout,
|
||||
"webActUI",
|
||||
"getActUserTaskDetail",
|
||||
req,
|
||||
GetActUserTaskDetailResp,
|
||||
uid=uid,
|
||||
cookie=cookie,
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
def query_user_score(self, uid: int, cookie: str, sid: int, timeout: float = 15.0):
|
||||
@@ -852,8 +863,14 @@ class HuyaHttpClient:
|
||||
)
|
||||
|
||||
def list_pay_channels(
|
||||
self, uid: int, guid: str, cookie: str, spu_id: str, sku_id: int,
|
||||
supplier_id: int = 87401, timeout: float = 15.0,
|
||||
self,
|
||||
uid: int,
|
||||
guid: str,
|
||||
cookie: str,
|
||||
spu_id: str,
|
||||
sku_id: int,
|
||||
supplier_id: int = 87401,
|
||||
timeout: float = 15.0,
|
||||
):
|
||||
from .shop_structs import ListPayChannelReq, ListPayChannelRsp
|
||||
|
||||
@@ -864,8 +881,14 @@ class HuyaHttpClient:
|
||||
req.spuId = spu_id
|
||||
req.skuId = int(sku_id or 0)
|
||||
return self.call_rpc(
|
||||
"shopMiddleUI", "listPayChannelV5", req, ListPayChannelRsp,
|
||||
uid, guid, cookie, timeout=timeout,
|
||||
"shopMiddleUI",
|
||||
"listPayChannelV5",
|
||||
req,
|
||||
ListPayChannelRsp,
|
||||
uid,
|
||||
guid,
|
||||
cookie,
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
def check_hy_protocol(
|
||||
@@ -877,12 +900,23 @@ class HuyaHttpClient:
|
||||
req.userId = self._build_shop_user(uid, cookie)
|
||||
req.shopAppInfo = self._build_shop_app("yellowcarlist", 4)
|
||||
return self.call_rpc(
|
||||
"shopMiddleUI", "checkHyProtocolV5", req, ShopCodeRsp,
|
||||
uid, guid, cookie, timeout=timeout,
|
||||
"shopMiddleUI",
|
||||
"checkHyProtocolV5",
|
||||
req,
|
||||
ShopCodeRsp,
|
||||
uid,
|
||||
guid,
|
||||
cookie,
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
def check_user_buy_auth(
|
||||
self, uid: int, guid: str, cookie: str, spu_id: str, sku_id: int,
|
||||
self,
|
||||
uid: int,
|
||||
guid: str,
|
||||
cookie: str,
|
||||
spu_id: str,
|
||||
sku_id: int,
|
||||
timeout: float = 15.0,
|
||||
):
|
||||
from .shop_structs import CheckUserBuyAuthReq, ShopCodeRsp
|
||||
@@ -893,8 +927,14 @@ class HuyaHttpClient:
|
||||
req.spuId = spu_id
|
||||
req.skuId = int(sku_id or 0)
|
||||
return self.call_rpc(
|
||||
"shopMiddleUI", "checkUserBuyAuth", req, ShopCodeRsp,
|
||||
uid, guid, cookie, timeout=timeout,
|
||||
"shopMiddleUI",
|
||||
"checkUserBuyAuth",
|
||||
req,
|
||||
ShopCodeRsp,
|
||||
uid,
|
||||
guid,
|
||||
cookie,
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
def query_user_order_list(
|
||||
|
||||
Reference in New Issue
Block a user