This commit is contained in:
piair
2023-06-24 16:39:42 +02:00
parent f098f13242
commit 4b0f33ae26
4 changed files with 51 additions and 12 deletions

25
V6.py
View File

@ -16,24 +16,26 @@ display = g.display
# create a webdriver
def firefox_driver(mobile=False, headless=False):
PC_USER_AGENT = (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
"Mozilla/5.0 (X11; Linux x86_64)"
"AppleWebKit/537.36 (KHTML, like Gecko)"
"Chrome/112.0.0.0 Safari/537.36 Edg/110.0.1587.56")
"Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.58"
)
MOBILE_USER_AGENT = (
"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X)"
"AppleWebKit/606.0.2 (KHTML, like Gecko)"
"CriOS/107.0.5060.64 Mobile/15E148 Safari/604.1"
"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N)"
"AppleWebKit/537.36 (KHTML, like Gecko)"
"Chrome/%s Mobile Safari/537.36"
)
chrome_options = webdriver.ChromeOptions()
#if mobile:
# chrome_options.add_argument(f"--user-agent={PC_USER_AGENT}")
#else :
# chrome_options.add_argument(f"--user-agent={MOBILE_USER_AGENT}")
## disabled as it may cause detection
if mobile:
chrome_options.add_argument(f"--user-agent={PC_USER_AGENT}")
else :
chrome_options.add_argument(f"--user-agent={MOBILE_USER_AGENT}")
# disabled as it may cause detection
if g.proxy_enabled:
PROXY = f"{g.proxy_address}:{g.proxy_port}" # IP:PORT or HOST:PORT
chrome_options.add_argument(f'--proxy-server={PROXY}')
driver = uc.Chrome(options=chrome_options)
set_language()
return(driver)
@ -433,7 +435,8 @@ def cookie_login(ldriver):
printf("No cookies file Found.")
return(False)
except Exception as e:
log_error(f"Error performing cookies login. Trying with password instead. \n{str(e)}", driver)
#log_error(f"Error performing cookies login. Trying with password instead. \n{str(e)}", driver)
print("error with cookies login. IDK why (yet)")
return(False)
try :
ldriver.refresh()