From f66d75344033aec8bcfbeb4b9e7d1c827ea769f6 Mon Sep 17 00:00:00 2001 From: Karan Adhikari Date: Thu, 1 Dec 2022 15:44:48 +0530 Subject: [PATCH] Ytdl fix for Authorized chat.. --- bot/modules/ytdlp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/modules/ytdlp.py b/bot/modules/ytdlp.py index 8405cf909c..be7e2870a9 100644 --- a/bot/modules/ytdlp.py +++ b/bot/modules/ytdlp.py @@ -7,7 +7,7 @@ from bot import * from bot.helper.telegram_helper.message_utils import sendMessage, sendMarkup, editMessage, auto_delete_upload_message, auto_delete_message -from bot.helper.ext_utils.bot_utils import get_readable_file_size, is_url, get_user_task +from bot.helper.ext_utils.bot_utils import get_readable_file_size, is_url, get_user_task, is_sudo, is_paid from bot.helper.ext_utils.timegap import timegap_check from bot.helper.mirror_utils.download_utils.yt_dlp_download_helper import YoutubeDLHelper from bot.helper.telegram_helper.bot_commands import BotCommands @@ -66,7 +66,7 @@ def _ytdl(bot, message, isZip=False, isLeech=False): user_id = message.from_user.id USER_TASKS_LIMIT = config_dict['USER_TASKS_LIMIT'] TOTAL_TASKS_LIMIT = config_dict['TOTAL_TASKS_LIMIT'] - if user_id != OWNER_ID and user_data[user_id].get('is_sudo') and user_data[user_id].get('is_paid'): + if user_id != OWNER_ID and not is_sudo(user_id) and not is_paid(user_id): if config_dict['PAID_SERVICE'] is True: if TOTAL_TASKS_LIMIT == total_task: return sendMessage(f"Bᴏᴛ Tᴏᴛᴀʟ Tᴀsᴋ Lɪᴍɪᴛ : {TOTAL_TASKS_LIMIT}\nTᴀsᴋs Pʀᴏᴄᴇssɪɴɢ : {total_task}\n#total limit exceed \n#Buy Paid Service", bot ,message) @@ -78,7 +78,7 @@ def _ytdl(bot, message, isZip=False, isLeech=False): if USER_TASKS_LIMIT == get_user_task(user_id): return sendMessage(f"Bᴏᴛ Usᴇʀ Tᴀsᴋ Lɪᴍɪᴛ : {USER_TASKS_LIMIT} \nYᴏᴜʀ Tᴀsᴋs : {get_user_task(user_id)}\n#user limit exceed", bot ,message) - if user_id != OWNER_ID and user_data[user_id].get('is_sudo') and user_data[user_id].get('is_paid'): + if user_id != OWNER_ID and not is_sudo(user_id) and not is_paid(user_id): time_gap = timegap_check(message) if time_gap: return