Spaces:
Running
Running
Update FileStream/utils/FileProcessors/bot_utils.py
Browse files
FileStream/utils/FileProcessors/bot_utils.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
import asyncio
|
3 |
import functools
|
4 |
from typing import (Union)
|
@@ -163,14 +163,14 @@ async def gen_link(_id):
|
|
163 |
file_name = file_info['file']['file_name'],
|
164 |
file_size = humanbytes(file_info['file']['file_size']),
|
165 |
mime_type = file_info['file']['mime_type'],
|
166 |
-
poster =
|
167 |
title= file_info["title"],
|
168 |
description= file_info['description'],
|
169 |
release_date= file_info["release_date"],
|
170 |
page_link = f"{Server.URL}app/watch/{_id}",
|
171 |
stream_link = f"{Server.URL}api/dl/{_id}",
|
172 |
file_link = f"https://t.me/{FileStream.username}?start=file_{_id}"
|
173 |
-
print(poster,type(poster)
|
174 |
|
175 |
if "video" in mime_type:
|
176 |
stream_text = LANG.STREAM_TEXT.format(poster,description,title,release_date,file_name, file_size, stream_link, page_link, file_link)
|
@@ -193,7 +193,7 @@ async def gen_link(_id):
|
|
193 |
InlineKeyboardButton("ʀᴇᴠᴏᴋᴇ ғɪʟᴇ",callback_data=f"msgdelpvt_{_id}")
|
194 |
], [InlineKeyboardButton("ᴄʟᴏsᴇ", callback_data="close")]
|
195 |
])
|
196 |
-
return {"reply_markup": reply_markup, "stream_text": stream_text, "poster":
|
197 |
|
198 |
|
199 |
#---------------------[ GEN STREAM LINKS FOR CHANNEL ]---------------------#
|
|
|
1 |
+
import urllib.parse
|
2 |
import asyncio
|
3 |
import functools
|
4 |
from typing import (Union)
|
|
|
163 |
file_name = file_info['file']['file_name'],
|
164 |
file_size = humanbytes(file_info['file']['file_size']),
|
165 |
mime_type = file_info['file']['mime_type'],
|
166 |
+
poster = ''.join(file_info.get("poster","")),
|
167 |
title= file_info["title"],
|
168 |
description= file_info['description'],
|
169 |
release_date= file_info["release_date"],
|
170 |
page_link = f"{Server.URL}app/watch/{_id}",
|
171 |
stream_link = f"{Server.URL}api/dl/{_id}",
|
172 |
file_link = f"https://t.me/{FileStream.username}?start=file_{_id}"
|
173 |
+
print(poster,type(poster))
|
174 |
|
175 |
if "video" in mime_type:
|
176 |
stream_text = LANG.STREAM_TEXT.format(poster,description,title,release_date,file_name, file_size, stream_link, page_link, file_link)
|
|
|
193 |
InlineKeyboardButton("ʀᴇᴠᴏᴋᴇ ғɪʟᴇ",callback_data=f"msgdelpvt_{_id}")
|
194 |
], [InlineKeyboardButton("ᴄʟᴏsᴇ", callback_data="close")]
|
195 |
])
|
196 |
+
return {"reply_markup": reply_markup, "stream_text": stream_text, "poster": urllib.parse.urlencode(poster) }
|
197 |
|
198 |
|
199 |
#---------------------[ GEN STREAM LINKS FOR CHANNEL ]---------------------#
|