From f87fa70274a85ef287dd581af0e75769723ccc6d Mon Sep 17 00:00:00 2001 From: PROFESSOR <66514907+Adithyan1133-ctrl@users.noreply.github.com> Date: Mon, 1 Mar 2021 18:34:40 +0530 Subject: [PATCH] Update extractor.py --- plugins/extractor.py | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/plugins/extractor.py b/plugins/extractor.py index 7e0da07..3112dc5 100644 --- a/plugins/extractor.py +++ b/plugins/extractor.py @@ -12,43 +12,23 @@ from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton from pyrogram.errors import UserNotParticipant -file_types = [ - "video/x-msvideo", - "video/x-flv", - "video/webm", - "video/x-m4v", - "video/mp4", - "video/mpeg", - "video/ogg", - "video/x-matroska", - "video/webm" -] - @trojanz.on_message(filters.private & (filters.document | filters.video)) async def confirm_dwnld(client, message): media = message filetype = media.document or media.video - if int(filetype.file_size/1024/1024) <= 8: - - if filetype.mime_type in file_types: - await message.reply_text( - "**Select the Optins Below**", - quote=True, - reply_markup=InlineKeyboardMarkup( - [[InlineKeyboardButton(text="DOWNLOAD", callback_data="download_file")], - [InlineKeyboardButton(text="CANCEL", callback_data="close")]] - ) - ) - else: - await message.reply_text( - "```Invalid Media```", - quote=True + if filetype.mime_type.startswith("video/"): + await message.reply_text( + "**Select the Optins Below**", + quote=True, + reply_markup=InlineKeyboardMarkup( + [[InlineKeyboardButton(text="DOWNLOAD", callback_data="download_file")], + [InlineKeyboardButton(text="CANCEL", callback_data="close")]] ) + ) else: await message.reply_text( - "**Cheriya Size Ayakkadey...**", + "```Invalid Media```", quote=True ) -