|
28 | 28 | __pname__ = "Turnstile Solver" |
29 | 29 |
|
30 | 30 | # mdata = metadata.metadata(__pname__) |
31 | | -__version__ = "0.3b" # mdata['Version'] |
| 31 | +__version__ = "1.2" # mdata['Version'] |
32 | 32 | __homepage__ = "https://github.com/odell0111/turnstile_solver" # mdata['Home-page'] |
33 | 33 | __author__ = "OGM" # mdata['Author'] |
34 | 34 | __summary__ = "Automatically solve Cloudflare Turnstile captcha" # mdata['Summary'] |
@@ -76,33 +76,33 @@ def positive_float(value): |
76 | 76 | raise argparse.ArgumentTypeError(f'"{value}" is not a number') |
77 | 77 | return value |
78 | 78 |
|
79 | | - # def positive_float_exclusive(value): |
80 | | - # try: |
81 | | - # value = float(value) |
82 | | - # if value != -1 and value <= 0: |
83 | | - # raise argparse.ArgumentTypeError(f"{value} is not a positive number") |
84 | | - # except ValueError: |
85 | | - # raise argparse.ArgumentTypeError(f'"{value}" is not a number') |
86 | | - # return value |
87 | | - # |
88 | | - # def positive_integer_exclusive(value): |
89 | | - # try: |
90 | | - # value = int(value) |
91 | | - # if value != -1 and value <= 0: |
92 | | - # raise argparse.ArgumentTypeError(f"{value} is not a positive integer") |
93 | | - # except ValueError: |
94 | | - # raise argparse.ArgumentTypeError(f'"{value}" is not an integer') |
95 | | - # return value |
| 79 | + def positive_float_exclusive(value): |
| 80 | + try: |
| 81 | + value = float(value) |
| 82 | + if value != -1 and value <= 0: |
| 83 | + raise argparse.ArgumentTypeError(f"{value} is not a positive number") |
| 84 | + except ValueError: |
| 85 | + raise argparse.ArgumentTypeError(f'"{value}" is not a number') |
| 86 | + return value |
| 87 | + |
| 88 | + def positive_integer_exclusive(value): |
| 89 | + try: |
| 90 | + value = int(value) |
| 91 | + if value != -1 and value <= 0: |
| 92 | + raise argparse.ArgumentTypeError(f"{value} is not a positive integer") |
| 93 | + except ValueError: |
| 94 | + raise argparse.ArgumentTypeError(f'"{value}" is not an integer') |
| 95 | + return value |
96 | 96 |
|
97 | 97 | parser.add_argument("-p", "--production", action="store_true", help=f"Whether the project is running in a production environment or on a resource-constrained server, such as one that spins down during periods of inactivity.") |
98 | 98 | parser.add_argument("-nn", "--no-ngrok", action="store_true", help=f"Do not use ngrok for keeping server alive on production.") |
99 | 99 | parser.add_argument("-ncomp", "--no-computations", action="store_true", help=f"Do not simulate intensive computations for keeping server alive on production.") |
100 | 100 | parser.add_argument("--headless", action="store_true", help=f"Open browser in headless mode. WARNING: This feature has never worked so far, captcha always fail! It's here only in case it works on future version of Playwright.") |
101 | 101 | parser.add_argument("-bep", "--browser-executable-path", help=f"Chromium-based browser executable path. If not specified, Patchright (Playwright) will attempt to use its bundled version. Ensure you are using a Chromium-based browser installed with the command `patchright install chromium`. Other browsers may be detected by Cloudflare, which could result in the CAPTCHA not being solved.") |
102 | 102 | parser.add_argument("-bp", "--browser-position", type=int, nargs='*', metavar="x|y", default=c.BROWSER_POSITION, help=f"Browser position x, y. Default: {c.BROWSER_POSITION}. If the browser window is positioned beyond the screen's resolution, it will be inaccessible, behaving similar to headless mode.") |
103 | | - parser.add_argument("-nfl", "--no-file-logs", action="store_true", help=f"Do not log to file '%HOME%/.turnstile_solver/logs.log'.") |
104 | | - |
105 | | - # Solver |
| 103 | + parser.add_argument("-nfl", "--no-file-logs", action="store_true", help=f"Do not log to file '$HOME.turnstile_solver/logs.log'.") |
| 104 | + # |
| 105 | + # # Solver |
106 | 106 | solver = parser.add_argument_group("Solver") |
107 | 107 | solver.add_argument("-ma", "--max-attempts", type=positive_integer, metavar="N", default=c.MAX_ATTEMPTS_TO_SOLVE_CAPTCHA, help=f"Max attempts to perform to solve captcha. Default: {c.MAX_ATTEMPTS_TO_SOLVE_CAPTCHA}.") |
108 | 108 | solver.add_argument("-cto", "--captcha-timeout", type=positive_float, metavar="N.", default=c.CAPTCHA_ATTEMPT_TIMEOUT, help=f"Max time to wait for captcha to solve before reloading page. Default: {c.CAPTCHA_ATTEMPT_TIMEOUT} seconds.") |
|
0 commit comments