File size: 1,101 Bytes
886cc56
e566133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0e49d61
 
 
 
e566133
fdbc27b
26741bb
0e49d61
65a6e80
d077c72
4895976
 
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
import pprint
from ..config import Telegram
from pyrogram import Client

if Telegram.SECONDARY:
  plugins = None
  no_updates = True
else:
  plugins = dict(root="FileStream/bot/plugins")
  no_updates = None

FileStream = Client(name="FileStream",
                    api_id=Telegram.API_ID,
                    api_hash=Telegram.API_HASH,
                    workdir="FileStream",
                    plugins=plugins,
                    bot_token=Telegram.BOT_TOKEN,
                    sleep_threshold=Telegram.SLEEP_THRESHOLD,
                    workers=Telegram.WORKERS,
                    no_updates=no_updates)


WORK_LOADS = {}
MULTI_CLIENTS = {}
ACTIVE_CLIENTS = {}

async def req_client(PUBLIC_IP:str)-> dict:
  index = min(WORK_LOADS, key=WORK_LOADS.get)
  faster_client = MULTI_CLIENTS[index]
  print("\n \nFaster Client",faster_client,type(faster_client),"\nWORK_LOADS",WORK_LOADS,type(WORK_LOADS),"\nMULTI_CLIENTS",MULTI_CLIENTS,type(MULTI_CLIENTS),"\n")
  #ACTIVE_CLIENTS.update(faster_client)
  response = dict(index=index,public_ip=PUBLIC_IP, client=faster_client)
  return response