Skip to content

Commit

Permalink
Merge branch 'y-tai:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
fairy-iu authored Sep 17, 2024
2 parents 4601be7 + 2711334 commit 36b74c2
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions zodgame/zodgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,7 @@
import undetected_chromedriver as uc
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By

def get_driver_version():
system = platform.system()

if system == "Darwin":
cmd = r'''/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version'''
elif system == "Windows":
cmd = r'''powershell -command "&{(Get-Item 'C:\Program Files\Google\Chrome\Application\chrome.exe').VersionInfo.ProductVersion}"'''

try:
out, err = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
except IndexError as e:
print('Check chrome version failed:{}'.format(e))
return 0

if system == "Darwin":
out = out.decode("utf-8").split(" ")[2].split(".")[0]
elif system == "Windows":
out = out.decode("utf-8").split(".")[0]

return out

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 Down Expand Up @@ -139,9 +118,10 @@ def show_task_reward(driver):
def zodgame(cookie_string):
options = uc.ChromeOptions()
options.add_argument("--disable-popup-blocking")

version = get_driver_version()
driver = uc.Chrome(version_main=version, options = options)
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)

# Load cookie
driver.get("https://zodgame.xyz/")
Expand Down

0 comments on commit 36b74c2

Please sign in to comment.