@@ -27,7 +27,7 @@ async def __anext__(self) -> bytes:
27
27
if current >= self .end :
28
28
raise StopAsyncIteration ()
29
29
read_size = min (self .buffer_size , self .end - current )
30
- if ( not self . worker . done and current >= self .current_part * Config .Part_size ) or current < self . last_read_byte :
30
+ if current >= self .current_part * Config .Part_size :
31
31
self .current_part = await self .check_dl (current ) + 1
32
32
self .last_read_byte = current
33
33
chunk = await self .file .read (read_size )
@@ -59,7 +59,7 @@ async def check_dl(self, current_byte):
59
59
60
60
@app .route ('/' )
61
61
async def root ():
62
- return redirect (f"https://t.me/{ Config . Bot_UserName } " )
62
+ return redirect (f"https://t.me/shadow_bots " )
63
63
64
64
65
65
@app .route ('/dl/<int:archive_id>/<name>' )
@@ -80,10 +80,7 @@ async def download(archive_id: int, name: str):
80
80
response = await send_file (worker .path , mimetype = worker .mime_type ,
81
81
as_attachment = not bool (request .args .get ('st' )),
82
82
attachment_filename = worker .name )
83
- try :
84
- if request .range is not None and len (request .range .ranges ) > 0 :
85
- await response .make_conditional (request .range , Config .Part_size if not worker .done else None )
86
- except AssertionError :
87
- pass # Bad Range Provided
88
- response .timeout = None
83
+ if request .range is not None and len (request .range .ranges ) > 0 :
84
+ await response .make_conditional (request .range , Config .Part_size )
85
+
89
86
return response
0 commit comments