-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
61 lines (47 loc) · 1.84 KB
/
main.py
File metadata and controls
61 lines (47 loc) · 1.84 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import asyncio
import noble_tls
from colorama import init
from fake_useragent import UserAgent
from noble_tls import Session, Client
from api.consign import ConsignManager
from api.offer import OfferManager
from api.seller import Seller
from utils.config import Config
from utils.log import Log, LogLevel
from utils.proxy import Proxies
init()
logger = Log('Home', LogLevel.DEBUG)
async def main():
try:
await noble_tls.update_if_necessary()
except Exception as e:
logger.warning(f'Failed to update noble_tls: {e}')
proxies: Proxies = Proxies()
config: Config = Config()
sellers: list[Seller] = []
for task, account in enumerate(config.accounts, start=1):
s: Session = Session(client=Client.CHROME_120, random_tls_extension_order=True)
ua: str = UserAgent().random
seller: Seller = Seller(proxies, config, s, ua, account, task)
await seller.init()
sellers.append(seller)
async def start_offer(x: Seller):
offers: OfferManager = OfferManager(x)
await offers.monitor_offers()
async def start_consign(x: list[Seller]):
consigns: ConsignManager = ConsignManager(x)
await consigns.monitor_consigns()
offer_tasks = [start_offer(x) for x in sellers]
await asyncio.gather(start_consign(sellers), *offer_tasks)
if __name__ == '__main__':
logger.title(
"""
__ __ _____ _ _____ _ _
\ \ / /_|_ _| |__ __|_ _|__ ___ | | |__ _____ __
\ \ /\ / / _ \| | | '_ \ / _ \| |/ _ \ / _ \| | '_ \ / _ \ \/ /
\ V V / __/| | | | | | __/| | (_) | (_) | | |_) | (_) > <
\_/\_/ \___||_| |_| |_|\___||_|\___/ \___/|_|_.__/ \___/_/\_\ v1.3
"""
)
print('Welcome to the WTN AIO toolbox coded by @Mathious6')
asyncio.run(main())