Compare commits

...

2 Commits

Author SHA1 Message Date
3f78de7239 fixed getPublicIp by adding user agent 2026-03-05 22:03:58 +01:00
cb90ff38cd updated hardcoded attributes 2026-03-05 22:03:25 +01:00

View File

@@ -48,7 +48,7 @@ errorLogger = Logger("ERROR", [ANSI.BOLD, ANSI.RED])
vpnLogger = Logger("", [ANSI.ITALIC, ANSI.BLACK+60])
def getPublicIp():
return requests.head("https://wikipedia.org").headers["X-Client-IP"]
return requests.head("https://wikipedia.org", headers={"User-Agent": "HEI-VPN 1.0"}).headers["X-Client-IP"]
if getPublicIp() == "153.109.1.93":
warningLogger.log("You are already in the HEI network. You cannot use the VPN")
@@ -164,7 +164,7 @@ def closeBrowser(driver: Firefox, distinguishkey: str) -> None:
try:
driver.quit()
except:
pass # error expected because we killed the processe
pass # error expected because we killed the process
# Cleanup
if os.path.isdir(realProfilePath):
@@ -206,7 +206,7 @@ driver.get(url)
wait = WebDriverWait(driver, timeout)
wait.until(AnyEc(
EC.url_contains("microsoft"),
EC.presence_of_element_located((By.CSS_SELECTOR, 'img[alt="app logo"]'))
EC.presence_of_element_located((By.CSS_SELECTOR, 'img[alt~="logo" i]'))
))
if "microsoft" in driver.current_url:
@@ -217,7 +217,7 @@ if "microsoft" in driver.current_url:
driver.get(url)
wait = WebDriverWait(driver, timeout)
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, 'img[alt="app logo"]')))
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, 'img[alt~="logo" i]')))
driver.implicitly_wait(0)
continueBtn = driver.find_elements(By.ID, "btnContinue")