This repository was archived by the owner on May 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
47 lines (36 loc) · 1.61 KB
/
main.py
File metadata and controls
47 lines (36 loc) · 1.61 KB
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
from utils.core import create_sessions
from utils.telegram import Accounts
from utils.NotPixel import NotPixel
from data.config import USE_PROXY, USE_TG_BOT, BOT_TOKEN
import asyncio
import os
import time
async def main():
action = int(input('Выберите действие:\n1. Начать сбор монет\n2. Создать сессию\n>'))
if not os.path.exists('sessions'):
os.mkdir('sessions')
if action == 2:
await create_sessions()
if action == 1:
accounts = await Accounts().get_accounts()
tasks = []
if USE_PROXY:
proxy_dict = {}
with open('proxy.txt', 'r', encoding='utf-8') as file:
proxy = [i.strip().split() for i in file.readlines() if len(i.strip().split()) == 2]
for prox, name in proxy:
proxy_dict[name] = prox
for thread, account in enumerate(accounts):
if account in proxy_dict:
tasks.append(
asyncio.create_task(NotPixel(account=account, thread=thread, proxy=proxy_dict[account]).main()))
else:
tasks.append(asyncio.create_task(NotPixel(account=account, thread=thread).main()))
else:
for thread, account in enumerate(accounts):
tasks.append(asyncio.create_task(NotPixel(account=account, thread=thread).main()))
await asyncio.gather(*tasks)
if __name__ == '__main__':
asyncio.run(main())
print("\nThe automation has been completed successfully!")
time.sleep(3)