Skip to content

Commit

Permalink
Update send_file.py
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyDeveloperr authored Sep 12, 2023
1 parent 38d7f70 commit 99ca262
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions handlers/send_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,24 @@ async def reply_forward(message: Message, file_id: int):
async def media_forward(bot: Client, user_id: int, file_id: int):
try:
if Config.FORWARD_AS_COPY is True:

lazy_filex = await bot.get_messages(chat_id=Config.DB_CHANNEL, message_ids=file_id)
lazy_file = await bot.send_cached_media(chat_id=Config.DB_CHANNEL, file_id=lazy_filex.id)
lazy_file = await bot.copy_message(chat_id=STREAM_LOGS, from_chat_id=Config.DB_CHANNEL,
message_id=file_id)
# lazy_filex = await bot.get_messages(chat_id=Config.DB_CHANNEL, message_ids=file_id)


lazy_stream = f"{URL}watch/{str(lazy_file.id)}/{quote_plus(get_name(lazy_file))}?hash={get_hash(lazy_file)}"
# lazy_download = f"{URL}{str(lazy_file.id)}/{quote_plus(get_name(lazy_file))}?hash={get_hash(lazy_file)}"
lazy_download = f"{URL}{str(lazy_file.id)}/{quote_plus(get_name(lazy_file))}?hash={get_hash(lazy_file)}"

return await bot.copy_message(chat_id=user_id, from_chat_id=Config.DB_CHANNEL,
message_id=file_id,
reply_markup=InlineKeyboardMarkup(
[
[
InlineKeyboardButton("Fast Download", url=lazy_download),
InlineKeyboardButton("watch Online", url=lazy_stream),
],
]),
)

return await bot.copy_message(chat_id=user_id, from_chat_id=Config.DB_CHANNEL,
message_id=file_id,
Expand Down

0 comments on commit 99ca262

Please sign in to comment.