From 55b95c5b4730934e23969c97a0fffe95ec2104b2 Mon Sep 17 00:00:00 2001 From: FA Tulloh <77918734+yourtulloh@users.noreply.github.com> Date: Wed, 11 Aug 2021 06:09:02 +0800 Subject: [PATCH] Oof --- bot/modules/watch.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/bot/modules/watch.py b/bot/modules/watch.py index 8c360dc..8b65d11 100644 --- a/bot/modules/watch.py +++ b/bot/modules/watch.py @@ -13,6 +13,7 @@ def _watch(bot: Bot, update, isTar=False): mssg = update.message.text message_args = mssg.split(' ') name_args = mssg.split('|') + try: link = message_args[1] except IndexError: @@ -23,6 +24,7 @@ def _watch(bot: Bot, update, isTar=False): msg += "This file will be downloaded in 720p quality and it's name will be Slam" sendMessage(msg, bot, update) return + try: if "|" in mssg: mssg = mssg.split("|") @@ -35,11 +37,12 @@ def _watch(bot: Bot, update, isTar=False): qual = f'bestvideo[height<={qual}]+bestaudio/best[height<={qual}]' except IndexError: qual = "bestvideo+bestaudio/best" + try: name = name_args[1] except IndexError: name = "" - reply_to = update.message.reply_to_message + pswd = "" listener = MirrorListener(bot, update, pswd, isTar) ydl = YoutubeDLHelper(listener) @@ -55,9 +58,18 @@ def watch(update, context): _watch(context.bot, update) -mirror_handler = CommandHandler(BotCommands.WatchCommand, watch, - filters=CustomFilters.authorized_chat | CustomFilters.authorized_user, run_async=True) -tar_mirror_handler = CommandHandler(BotCommands.TarWatchCommand, watchTar, - filters=CustomFilters.authorized_chat | CustomFilters.authorized_user, run_async=True) +mirror_handler = CommandHandler( + BotCommands.WatchCommand, + watch, + filters=CustomFilters.authorized_chat | CustomFilters.authorized_user, + run_async=True, +) +tar_mirror_handler = CommandHandler( + BotCommands.TarWatchCommand, + watchTar, + filters=CustomFilters.authorized_chat | CustomFilters.authorized_user, + run_async=True, +) + dispatcher.add_handler(mirror_handler) dispatcher.add_handler(tar_mirror_handler)