Skip to content

Commit

Permalink
Update zodgame.py
Browse files Browse the repository at this point in the history
JiuZ-Chn authored Oct 13, 2024
1 parent 29e1c52 commit 347a015
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions zodgame/zodgame.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
import sys
import nodriver
from nodriver import cdp
sys.stdout.reconfigure(encoding='utf-8')
#sys.stdout.reconfigure(encoding='utf-8')

async def zodgame_checkin(tab, formhash):

@@ -29,7 +29,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

@@ -52,7 +52,7 @@ async def show_task_reward(broswer):
success = True

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

for idx, a in enumerate(join_task):
@@ -65,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} 成功。")
#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)

0 comments on commit 347a015

Please sign in to comment.