Skip to content

Commit

Permalink
Update zodgame.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuZ-Chn authored Oct 13, 2024
1 parent 02cd982 commit f05ea76
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions zodgame/zodgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async def zodgame_checkin(tab, formhash):
resp = await tab.evaluate(checkin_query, await_promise=True, return_by_value=True)
match = re.search('<div class="c">\n(.*?)</div>\n', resp, re.S)
message = match[1] if match is not None else "签到失败"
print(f"【签到】{message}")
#print(f"【签到】{message}")

return "恭喜你签到成功!" in message or "您今日已经签到,请明天再来" in message

Expand All @@ -51,8 +51,9 @@ async def show_task_reward(broswer):
success = True

if len(join_task) == 0:
print("【任务】所有任务均已完成。")
#print("【任务】所有任务均已完成。")
#return success
pass

for idx, a in enumerate(join_task):
print(a.attrs)
Expand All @@ -64,21 +65,21 @@ async def show_task_reward(broswer):
try:
await tab.find('//div[text()="成功!"', timeout=240)
except:
print(f"【Log】任务 {idx+1} 广告页检查失败。")
#print(f"【Log】任务 {idx+1} 广告页检查失败。")
pass

try:
check_url = re.search("""showWindow('check', '(.*)');""", on_click, re.S)[1]
tab = await tab.get(f"https://zodgame.xyz/{check_url}")
await tab.find('//p[contains(text(), "检查成功, 积分已经加入您的帐户中")] | //title[text()="BUX广告点击赚积分 - ZodGame论坛 - Powered by Discuz!"]')
except:
print(f"【Log】任务 {idx+1} 确认页检查失败。")
#print(f"【Log】任务 {idx+1} 确认页检查失败。")
pass

print(f"【任务】任务 {idx+1} 成功。")
except Exception as e:
success = False
print(f"【任务】任务 {idx+1} 失败。", type(e))
#print(f"【任务】任务 {idx+1} 失败。", type(e))

await show_task_reward(broswer)

Expand Down

0 comments on commit f05ea76

Please sign in to comment.