From 549b626ddae83daa9d7d0a2fa4bd1845a02b553e Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 24 Oct 2023 00:19:44 -0400 Subject: [PATCH] fix(youtubedownloader): filter streams correctly --- youtubedownloader/youtubedownloader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtubedownloader/youtubedownloader.py b/youtubedownloader/youtubedownloader.py index d11a626..621d2cb 100644 --- a/youtubedownloader/youtubedownloader.py +++ b/youtubedownloader/youtubedownloader.py @@ -67,11 +67,11 @@ class YouTubeDownloader(commands.Cog): yt = YouTube(url=url) filename = f"{yt.title} ({yt.video_id})" if audio_only: - yt.streams.filter(progressive=True, only_audio=True, file_extension='m4a') + yt.streams.filter(only_audio=True, mime_type='audio/mp4') yt.streams.order_by('abr') filename_format = filename + ".m4a" else: - yt.streams.filter(progressive=True, file_extension="mp4") + yt.streams.filter(progressive=True, mime_type="video/mp4") yt.streams.order_by('resolution') filename_format = filename + ".mp4" if os.path.isfile(path + f"{os.sep}{filename_format}"):