diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3088912..f0889d6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -26,7 +26,8 @@ jobs: run: | python -m pip install --upgrade pip pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if (Test-Path requirements.txt) { pip install -r requirements.txt } + shell: pwsh - name: Lint with flake8 run: | diff --git a/lib/bypass.py b/lib/bypass.py index 34b601e..a49ed96 100644 --- a/lib/bypass.py +++ b/lib/bypass.py @@ -4,6 +4,7 @@ import time from DrissionPage import ChromiumPage + class CloudflareBypasser: def __init__(self, driver: ChromiumPage, max_retries=-1, log=True): self.driver = driver @@ -37,7 +38,7 @@ def search_recursively_shadow_root_with_cf_input(self, ele): except Exception as e: self.log_message(f"Error searching shadow root with CF input: {e}") return None - + def locate_cf_button(self): try: button = None @@ -47,7 +48,7 @@ def locate_cf_button(self): if "turnstile" in ele.attrs["name"] and ele.attrs["type"] == "hidden": button = ele.parent().shadow_root.child()("tag:body").shadow_root("tag:input") break - + if button: return button else: @@ -104,4 +105,4 @@ def bypass(self): if self.is_bypassed(): self.log_message("Bypass successful.") else: - self.log_message("Bypass failed.") \ No newline at end of file + self.log_message("Bypass failed.") diff --git a/lib/lib.py b/lib/lib.py index 6249b0a..ff0f443 100644 --- a/lib/lib.py +++ b/lib/lib.py @@ -1,8 +1,6 @@ import string import random -import toml import asyncio -import platform class Main: @@ -44,5 +42,6 @@ async def switchDomain(maildomain, externaldomain): ) return externaldomain + if __name__ == "__main__": print("This is a library file. Please run main.py instead.") diff --git a/main.py b/main.py index fdd7469..43c2c57 100644 --- a/main.py +++ b/main.py @@ -9,6 +9,7 @@ warnings.filterwarnings("ignore", category=TqdmExperimentalWarning) + async def main(): port = ChromiumOptions().auto_port() @@ -29,7 +30,7 @@ async def main(): ) print() executionCount = int(executionCount) if executionCount.isdigit() else 1 - + for x in range(executionCount): bar = tqdm(total=100) bar.set_description(f"Initial setup completed [{x + 1}/{executionCount}]") @@ -142,7 +143,7 @@ async def main(): bar.update(20) tab.get(link) - bar.set_description(f"Clearing cache and data") + bar.set_description("Clearing cache and data") bar.update(9) tab.set.cookies.clear() tab.clear_cache() @@ -177,4 +178,4 @@ async def main(): print("\033[0m" "\nCredentials saved to accounts.txt\nHave fun using ExitLag!") if __name__ == "__main__": - asyncio.run(main()) \ No newline at end of file + asyncio.run(main())