-
Notifications
You must be signed in to change notification settings - Fork 67
/
main.py
78 lines (68 loc) · 2.48 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import asyncio
import sys
from config import TITLE
from termcolor import cprint
from questionary import Choice, select
from modules.interfaces import SoftwareException
from utils.modules_runner import Runner
from utils.route_generator import RouteGenerator
from utils.tools import check_progress_file
def are_you_sure(module=None, gen_route:bool = False):
if gen_route or check_progress_file():
answer = select(
'\n ⚠️⚠️⚠️ THAT ACTION WILL DELETE ALL PREVIOUS PROGRESS FOR CLASSIC-ROUTES, continue? ⚠️⚠️⚠️ \n',
choices=[
Choice("❌ NO", 'main'),
Choice("✅ YES", 'module'),
],
qmark='☢️',
pointer='👉'
).ask()
print()
if answer == 'main':
main()
else:
if module:
module()
def main():
cprint(TITLE, color='light_cyan')
cprint(f'\n❤️ My channel for latest updates: https://t.me/askaer\n', 'light_green', attrs=["blink"])
try:
while True:
answer = select(
'What do you want to do?',
choices=[
Choice("🚀 Start running classic routes for each wallet", 'classic_routes_run'),
Choice("📄 Generate classic-route for each wallet", 'classic_routes_gen'),
Choice("✅ Check the connection of each proxy", 'check_proxy'),
Choice('❌ Exit', "exit")
],
qmark='🛠️',
pointer='👉'
).ask()
runner = Runner()
if answer == 'check_proxy':
print()
asyncio.run(runner.check_proxies_status())
print()
elif answer == 'classic_routes_run':
print()
asyncio.run(runner.run_accounts())
print()
elif answer == 'classic_routes_gen':
generator = RouteGenerator()
are_you_sure(generator.classic_routes_json_save, gen_route=True)
elif answer == 'exit':
sys.exit()
else:
print()
answer()
print()
except KeyboardInterrupt:
cprint(f'\nQuick software shutdown by <ctrl + C>', color='light_yellow')
sys.exit()
except SoftwareException as error:
cprint(f'\n{error}', color='light_red')
sys.exit()
if __name__ == "__main__":
main()