feat(douyu): 和平小店扭蛋碎片查询 + 深色模式修复 + 任务状态 WS 即时推送
- 碎片: 新增 query_xpd_fragments 任务, 复用 e语言 gamecoin 接口取扭蛋币 jb2, 账号已存角色回退(规避 Livelink 风控), accounts.xpd_fragments 字段与迁移 - 列表: 和平小店移除鱼翅/限制兑换/换绑时间列, 新增扭蛋碎片列; 操作区硬编码白底改用 theme token, 深色模式适配(三个手册共用) - 轮询: 任务状态经 WS(level=task)即时推送(二维码/绑定进度即时展示), pending/running/终态全覆盖, REST/WS 载荷统一 douyu_task_payload, raw 快照递归剥离, HTTP 轮询降频 5s/30s 兜底
This commit is contained in:
@@ -1105,3 +1105,44 @@ class DouyuActivityClient:
|
||||
)
|
||||
info = self._xpd_parse_var(response.text, "banlanceInfo")
|
||||
return {"balance": self._xpd_int(info.get("balance")), "raw": info}
|
||||
|
||||
def xpd_fragments(
|
||||
self,
|
||||
*,
|
||||
embed_query: dict[str, str],
|
||||
act_id: str,
|
||||
openid: str,
|
||||
roleid: str,
|
||||
plat: str,
|
||||
areaid: str = "1",
|
||||
) -> dict[str, Any]:
|
||||
"""查询和平小店角色扭蛋碎片数量(gamecoin jb2)。"""
|
||||
params = {
|
||||
"_jsvar": "jbInfos",
|
||||
"_service": "pay.idip.gamecoin.get",
|
||||
"_app_id": "2123",
|
||||
"acctype": "ttpp",
|
||||
"areaid": str(areaid),
|
||||
"eventid": "",
|
||||
"interwork": "0",
|
||||
"openid": openid,
|
||||
"openkey": "openkey",
|
||||
"partition": "0",
|
||||
"pay_token": "",
|
||||
"plat": str(plat),
|
||||
"plat_pc": "0",
|
||||
"roleid": roleid,
|
||||
"_biz_code": "cjm",
|
||||
"_act_id": act_id,
|
||||
"coin_type": "1",
|
||||
"_sid": "6",
|
||||
}
|
||||
response = self._request(
|
||||
"get",
|
||||
self.XPD_BALANCE_API,
|
||||
source="查询小店扭蛋碎片",
|
||||
params=params,
|
||||
headers=self._xpd_daoju_headers(),
|
||||
)
|
||||
info = self._xpd_parse_var(response.text, "jbInfos")
|
||||
return {"fragments": self._xpd_int(info.get("jb2")), "raw": info}
|
||||
|
||||
Reference in New Issue
Block a user