From 8e8fa0b71f3568159a2448a48fd4fadde49f6ce3 Mon Sep 17 00:00:00 2001 From: yasirarism <55983182+yasirarism@users.noreply.github.com> Date: Fri, 16 Dec 2022 09:52:16 +0700 Subject: [PATCH] Update ytdl_download_new.py --- misskaty/plugins/ytdl_download_new.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misskaty/plugins/ytdl_download_new.py b/misskaty/plugins/ytdl_download_new.py index d6a9ea45..933b2305 100644 --- a/misskaty/plugins/ytdl_download_new.py +++ b/misskaty/plugins/ytdl_download_new.py @@ -68,9 +68,10 @@ async def ytdownv2(_, message): async with iYTDL( log_group_id=0, cache_path="cache", ffmpeg_location="/usr/bin/mediaextract" ) as ytdl: - x = await ytdl.parse(url) - if x is None: - return await message.reply("Failed parse URL, check logs..") + try: + x = await ytdl.parse(url) + except Exception err: + return await message.reply(f"{err}") img = await get_ytthumb(x.key) caption = x.caption markup = x.buttons