()
| 8 | |
| 9 | |
| 10 | async def main() -> None: |
| 11 | parser = ArgumentParser() |
| 12 | parser.add_argument("-a", "--action", type=int, help="Action to perform") |
| 13 | print(start_text) |
| 14 | logger.info(f"Detected {len(get_session_names())} sessions | {len(get_proxies())} proxies") |
| 15 | |
| 16 | action = parser.parse_args().action |
| 17 | |
| 18 | actions = { |
| 19 | 1: run_tasks, |
| 20 | 2: register_sessions |
| 21 | } |
| 22 | |
| 23 | if not action: |
| 24 | print(f"Select an action:\n 1. Run clicker\n 2. Create session") |
| 25 | while True: |
| 26 | action = input("> ") |
| 27 | if not action.isdigit(): |
| 28 | logger.warning("<red>Action must be number</red>") |
| 29 | elif int(action) not in actions: |
| 30 | logger.warning("<red>Action must be <cyan>1</cyan> or <cyan>2</cyan></red>") |
| 31 | else: |
| 32 | action = int(action) |
| 33 | break |
| 34 | |
| 35 | await actions[action]() |
| 36 | |
| 37 | if __name__ == '__main__': |
| 38 | try: |
no test coverage detected