Spaces:
Running
Running
Commit
·
d3df831
1
Parent(s):
65a6e80
Slight Edit
Browse files
FileStream/server/Functions/downloader.py
CHANGED
@@ -23,7 +23,7 @@ async def media_streamer(request: web.Request, db_id: str, speed: str):
|
|
23 |
# Get the Range header from the request, default to 0 if not present
|
24 |
range_header = request.headers.get("Range", 0)
|
25 |
Worker = await req_client(request.remote)
|
26 |
-
client=Worker
|
27 |
# Log client info if multi-client mode
|
28 |
|
29 |
if Telegram.MULTI_CLIENT:
|
@@ -33,13 +33,13 @@ async def media_streamer(request: web.Request, db_id: str, speed: str):
|
|
33 |
#tg_connect = ACTIVE_CLIENTS.get(client['client'], None)
|
34 |
|
35 |
if client in ACTIVE_CLIENTS:
|
36 |
-
logging.info(f"
|
37 |
tg_connect = ACTIVE_CLIENTS(client)
|
38 |
|
39 |
else:
|
40 |
tg_connect = utils.ByteStreamer(client)
|
41 |
ACTIVE_CLIENTS[client] = tg_connect
|
42 |
-
logging.info(f"
|
43 |
|
44 |
tg_connect.update_last_activity()
|
45 |
|
|
|
23 |
# Get the Range header from the request, default to 0 if not present
|
24 |
range_header = request.headers.get("Range", 0)
|
25 |
Worker = await req_client(request.remote)
|
26 |
+
client=Worker.get("client")
|
27 |
# Log client info if multi-client mode
|
28 |
|
29 |
if Telegram.MULTI_CLIENT:
|
|
|
33 |
#tg_connect = ACTIVE_CLIENTS.get(client['client'], None)
|
34 |
|
35 |
if client in ACTIVE_CLIENTS:
|
36 |
+
logging.info(f"Using cached ByteStreamer object for client {Worker['index']}")
|
37 |
tg_connect = ACTIVE_CLIENTS(client)
|
38 |
|
39 |
else:
|
40 |
tg_connect = utils.ByteStreamer(client)
|
41 |
ACTIVE_CLIENTS[client] = tg_connect
|
42 |
+
logging.info(f"Creating new ByteStreamer object for client {Worker['index']}")
|
43 |
|
44 |
tg_connect.update_last_activity()
|
45 |
|