-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.py
39 lines (30 loc) · 1012 Bytes
/
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
import asyncio
import sys
from config import settings
from config.settings import *
from core.registrator import *
from utils.launcher import *
from utils.logger import logger
async def main():
global user_data
global tasks
logger.warning(
f"System | <y>Random wait "
f"{settings.WAIT_LOGIN[0]}-{settings.WAIT_LOGIN[1]} sec to authorization!</y>"
)
if not await get_session():
logger.error(f"System | <r>Error load session...</r>")
sys.exit(1)
if not await get_proxies():
logger.warning(f"System | <y>Error load proxy, use none</y>")
if not await get_user_agent():
logger.warning(f"System | <y>Randomize user-agent is loaded</y>")
tasks = [start(index) for index in range(user_data["count_user"])]
await asyncio.gather(*tasks)
if __name__ == "__main__":
try:
print(banner)
asyncio.run(main())
except KeyboardInterrupt:
logger.warning("<r>Bot stopped by user...</r>")
sys.exit(2)