Skip to content

Commit

Permalink
Update zodgame.py (y-tai#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
y-tai authored Oct 26, 2024
1 parent ba2f0e5 commit dc04cd1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions zodgame/zodgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
import io
import re
import sys
import platform
import subprocess
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')

import undetected_chromedriver as uc
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
import requests

def zodgame_checkin(driver, formhash):
checkin_url = "https://zodgame.xyz/plugin.php?id=dsu_paulsign:sign&operation=qiandao&infloat=1&inajax=0"
Expand All @@ -28,11 +25,12 @@ def zodgame_checkin(driver, formhash):
checkin_query = checkin_query.replace("\n", "")
driver.set_script_timeout(240)
resp = driver.execute_script("return " + checkin_query)
match = re.search('<div class="c">\n(.*?)</div>\n', resp["response"], re.S)
match = re.search('<div class="c">\r\n(.*?)</div>\r\n', resp["response"], re.S)
message = match[1] if match is not None else "签到失败"
print(f"【签到】{message}")
return "恭喜你签到成功!" in message or "您今日已经签到,请明天再来" in message


def zodgame_task(driver, formhash):

def clear_handles(driver, main_handle):
Expand Down Expand Up @@ -118,7 +116,6 @@ def show_task_reward(driver):
def zodgame(cookie_string):
options = uc.ChromeOptions()
options.add_argument("--disable-popup-blocking")
options.add_argument("--headless")
driver = uc.Chrome(driver_executable_path = """C:\SeleniumWebDrivers\ChromeDriver\chromedriver.exe""",
browser_executable_path = """C:\Program Files\Google\Chrome\Application\chrome.exe""",
options = options)
Expand Down

0 comments on commit dc04cd1

Please sign in to comment.