Karan Adhikari commited on
Update stream_routes.py
Browse files
Backend/fastapi/routes/stream_routes.py
CHANGED
|
@@ -12,7 +12,7 @@ from collections import deque
|
|
| 12 |
from Backend import db
|
| 13 |
from Backend.helper.encrypt import decode_string
|
| 14 |
from Backend.helper.exceptions import InvalidHash
|
| 15 |
-
from Backend.helper.custom_dl import ByteStreamer, ACTIVE_STREAMS, RECENT_STREAMS
|
| 16 |
from Backend.pyrofork.bot import work_loads, multi_clients, client_dc_map, client_failures, client_avg_mbps
|
| 17 |
from Backend.config import Telegram
|
| 18 |
from Backend.logger import LOGGER
|
|
@@ -278,8 +278,7 @@ async def media_streamer(
|
|
| 278 |
start, end = parse_range_header(range_header, file_size)
|
| 279 |
req_length = end - start + 1
|
| 280 |
|
| 281 |
-
|
| 282 |
-
chunk_size = get_adaptive_chunk_size(index)
|
| 283 |
offset = start - (start % chunk_size)
|
| 284 |
first_part_cut = start - offset
|
| 285 |
last_part_cut = (end % chunk_size) + 1
|
|
|
|
| 12 |
from Backend import db
|
| 13 |
from Backend.helper.encrypt import decode_string
|
| 14 |
from Backend.helper.exceptions import InvalidHash
|
| 15 |
+
from Backend.helper.custom_dl import ByteStreamer, ACTIVE_STREAMS, RECENT_STREAMS
|
| 16 |
from Backend.pyrofork.bot import work_loads, multi_clients, client_dc_map, client_failures, client_avg_mbps
|
| 17 |
from Backend.config import Telegram
|
| 18 |
from Backend.logger import LOGGER
|
|
|
|
| 278 |
start, end = parse_range_header(range_header, file_size)
|
| 279 |
req_length = end - start + 1
|
| 280 |
|
| 281 |
+
chunk_size = 1024 * 1024
|
|
|
|
| 282 |
offset = start - (start % chunk_size)
|
| 283 |
first_part_cut = start - offset
|
| 284 |
last_part_cut = (end % chunk_size) + 1
|