From fc0f222ad32738e2af816a548e66bb1990dd8d42 Mon Sep 17 00:00:00 2001 From: Alisson Lauffer Date: Sat, 30 Sep 2023 20:36:25 -0300 Subject: [PATCH] youtube: fix ytdl command --- eduu/plugins/youtube.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eduu/plugins/youtube.py b/eduu/plugins/youtube.py index ef0a74e1d1..bd71868b5e 100644 --- a/eduu/plugins/youtube.py +++ b/eduu/plugins/youtube.py @@ -100,9 +100,9 @@ async def ytdlcmd(c: Client, m: Message, strings): yt = yt["entries"][0] for f in yt["formats"]: - if f["format_id"] == "140": + if f["format_id"] == "140" and f.get("filesize") is not None: afsize = f["filesize"] or 0 - if f["ext"] == "mp4" and f["filesize"] is not None: + if f["ext"] == "mp4" and f.get("filesize") is not None: vfsize = f["filesize"] or 0 keyboard = [