-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
30 lines (26 loc) · 976 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
import asyncio
from contextlib import suppress
from bot.core.launcher import process
from bot.utils import PROXY_CHAIN, logger
from bot.utils.proxy_utils import get_proxy_chain, check_proxy
from os import system
async def main():
if PROXY_CHAIN:
proxy_str, proxy = await get_proxy_chain(PROXY_CHAIN)
if proxy:
logger.info("Getting proxy for Proxy Chain")
if await check_proxy(proxy_str):
import socket, socks
socks.set_default_proxy(proxy)
socket.socket = socks.socksocket
else:
logger.error("Proxy chain didn't respond. Can't start the bot using proxy chain")
input('Press any key to exit: ')
exit(0)
else:
logger.warning("No valid proxy found. Skipping")
await process()
if __name__ == '__main__':
system('title Dogiators')
with suppress(KeyboardInterrupt):
asyncio.run(main())