Skip to content

Commit

Permalink
ci: Use jQuery to input username/password/2FA
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Oct 27, 2024
1 parent 03b7a91 commit 4baca96
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Scripts/gamebanana_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ def main():
time.sleep(1)

print("Performing username + password login...", end=" ", flush=True)
driver.find_element(By.ID, "_sUsername").click()
driver.find_element(By.ID, "_sUsername").send_keys(os.getenv("GAMEBANANA_USERNAME"))
driver.find_element(By.ID, "_sPassword").click()
driver.find_element(By.ID, "_sPassword").send_keys(os.getenv("GAMEBANANA_PASSWORD"))
driver.execute_script(f"$('#_sUsername')[0].value = '{os.getenv("GAMEBANANA_USERNAME")}'")
driver.execute_script(f"$('#_sPassword')[0].value = '{os.getenv("GAMEBANANA_PASSWORD")}'")
driver.execute_script("$('#UsernameLoginForm button').click()")
print("Done", flush=True)

Expand All @@ -69,7 +67,7 @@ def main():
# Enter 2FA code if needed
if driver.current_url == "https://gamebanana.com/members/account/login":
print("Entering 2FA code...", end=" ", flush=True)
driver.find_element(By.ID, "_nTotp").send_keys(compute_twofac_code(os.getenv("GAMEBANANA_2FA_URI")))
driver.execute_script(f"$('#_nTotp')[0].value = '{compute_twofac_code(os.getenv("GAMEBANANA_2FA_URI"))}'")
print("Done", flush=True)

driver.implicitly_wait(5)
Expand Down

0 comments on commit 4baca96

Please sign in to comment.