mirror of
https://github.com/TDSCDMAA/AutoMihoyoBBS.git
synced 2026-06-02 18:43:42 +08:00
更新判断是否签到了
This commit is contained in:
parent
675a8c0cc4
commit
010fe7d988
@ -1,3 +1,4 @@
|
||||
import json
|
||||
import tools
|
||||
import config
|
||||
import setting
|
||||
@ -32,14 +33,17 @@ class CloudGenshin:
|
||||
|
||||
def sign_account(self) -> str:
|
||||
ret_msg = "云原神:\r\n"
|
||||
req = http.get(url=setting.cloud_genshin_Inquire, headers=self.headers)
|
||||
req = http.get(url=setting.cloud_genshin_sgin, headers=self.headers)
|
||||
data = req.json()
|
||||
data2 = http.get(url=setting.cloud_genshin_inquire, headers=self.headers).json()
|
||||
if data['retcode'] == 0:
|
||||
if req["data"]["free_time"]['free_time'] == '0':
|
||||
log.info('签到失败,未获得免费时长,可能是已经签到过了或者超出免费时长上线')
|
||||
if len(data2['data']['list']) >= 1:
|
||||
log.info('签到成功,已获得15分钟免费时长')
|
||||
ret_msg = f'签到成功,已获得15分钟免费时长\n'
|
||||
else:
|
||||
log.info(f'签到成功,已获得{data["data"]["free_time"]["free_time"]}分钟免费时长')
|
||||
ret_msg = f'你当前拥有免费时长 {self.Time_Conversion(int(data["data"]["free_time"]["free_time"]))} ,' \
|
||||
log.info('签到失败,未获得免费时长,可能是已经签到过了或者超出免费时长上线')
|
||||
ret_msg = '签到失败,未获得免费时长,可能是已经签到过了或者超出免费时长上线\n'
|
||||
ret_msg += f'你当前拥有免费时长 {self.Time_Conversion(int(data["data"]["free_time"]["free_time"]))} ,' \
|
||||
f'畅玩卡状态为 {data["data"]["play_card"]["short_msg"]},拥有米云币 {data["data"]["coin"]["coin_num"]} 枚'
|
||||
log.info(ret_msg)
|
||||
elif data['retcode'] == -100:
|
||||
|
||||
2
main.py
2
main.py
@ -103,7 +103,7 @@ def main():
|
||||
else:
|
||||
cloud_ys = cloud_genshin.CloudGenshin()
|
||||
data = cloud_ys.sign_account()
|
||||
return_data += "\n\n" + data
|
||||
return_data += "\n\n云原神:\n" + data
|
||||
return ret_code, return_data
|
||||
elif config.config["account"]["cookie"] == "CookieError":
|
||||
raise CookieError('Cookie expires')
|
||||
|
||||
@ -116,4 +116,5 @@ genshin_Signurl = web_Api + "/event/bbs_sign_reward/sign"
|
||||
|
||||
# 云原神相关api
|
||||
cloud_genshin_Api = "https://api-cloudgame.mihoyo.com"
|
||||
cloud_genshin_Inquire = cloud_genshin_Api + "/hk4e_cg_cn/wallet/wallet/get"
|
||||
cloud_genshin_sgin = cloud_genshin_Api + "/hk4e_cg_cn/wallet/wallet/get"
|
||||
cloud_genshin_inquire = cloud_genshin_Api + "/hk4e_cg_cn/gamer/api/listNotifications?status=NotificationStatusUnread&type=NotificationTypePopup&is_sort=true"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user