Spaces:
Running
Running
Commit
·
81b9358
1
Parent(s):
08193bb
Testing Changes
Browse files
FileStream/bot/__init__.py
CHANGED
@@ -27,7 +27,8 @@ ACTIVE_CLIENTS = {}
|
|
27 |
async def req_client(PUBLIC_IP:str)-> dict:
|
28 |
index = min(WORK_LOADS, key=WORK_LOADS.get)
|
29 |
faster_client = MULTI_CLIENTS[index]
|
30 |
-
print("
|
|
|
31 |
#ACTIVE_CLIENTS.update(faster_client)
|
32 |
-
response = dict(index=index,public_ip=PUBLIC_IP, client=faster_client)
|
33 |
-
return
|
|
|
27 |
async def req_client(PUBLIC_IP:str)-> dict:
|
28 |
index = min(WORK_LOADS, key=WORK_LOADS.get)
|
29 |
faster_client = MULTI_CLIENTS[index]
|
30 |
+
print("WorkLoads :",WORK_LOADS)
|
31 |
+
#print("\n \nFaster Client",faster_client,type(faster_client),"\nWORK_LOADS",WORK_LOADS,type(WORK_LOADS),"\nMULTI_CLIENTS",MULTI_CLIENTS,type(MULTI_CLIENTS),"\n")
|
32 |
#ACTIVE_CLIENTS.update(faster_client)
|
33 |
+
#response = dict(index=index,public_ip=PUBLIC_IP, client=faster_client)
|
34 |
+
return dict(index=index,public_ip=PUBLIC_IP, client=faster_client)
|
FileStream/server/Functions/downloader.py
CHANGED
@@ -27,20 +27,20 @@ async def media_streamer(request: web.Request, db_id: str, speed: str):
|
|
27 |
# Log client info if multi-client mode
|
28 |
|
29 |
if Telegram.MULTI_CLIENT:
|
30 |
-
print("ACTIVE Client",ACTIVE_CLIENTS)
|
31 |
logging.info(f"Client {Worker['index']} is now serving {request.headers.get('X-FORWARDED-FOR', request.remote)}")
|
32 |
|
33 |
# Use an existing ByteStreamer or create a new one
|
34 |
#tg_connect = ACTIVE_CLIENTS.get(client['client'], None)
|
35 |
|
36 |
if client in ACTIVE_CLIENTS:
|
37 |
-
logging.
|
38 |
tg_connect = ACTIVE_CLIENTS[client]
|
39 |
|
40 |
else:
|
41 |
tg_connect = utils.ByteStreamer(client)
|
42 |
ACTIVE_CLIENTS[client] = tg_connect
|
43 |
-
logging.
|
44 |
|
45 |
tg_connect.update_last_activity()
|
46 |
|
|
|
27 |
# Log client info if multi-client mode
|
28 |
|
29 |
if Telegram.MULTI_CLIENT:
|
30 |
+
#print("ACTIVE Client",ACTIVE_CLIENTS)
|
31 |
logging.info(f"Client {Worker['index']} is now serving {request.headers.get('X-FORWARDED-FOR', request.remote)}")
|
32 |
|
33 |
# Use an existing ByteStreamer or create a new one
|
34 |
#tg_connect = ACTIVE_CLIENTS.get(client['client'], None)
|
35 |
|
36 |
if client in ACTIVE_CLIENTS:
|
37 |
+
logging.debug(f"Using cached ByteStreamer object for client {Worker['index']}")
|
38 |
tg_connect = ACTIVE_CLIENTS[client]
|
39 |
|
40 |
else:
|
41 |
tg_connect = utils.ByteStreamer(client)
|
42 |
ACTIVE_CLIENTS[client] = tg_connect
|
43 |
+
logging.debug(f"Creating new ByteStreamer object for client {Worker['index']}")
|
44 |
|
45 |
tg_connect.update_last_activity()
|
46 |
|