From b45bddc548a90071bdd981c217ffd7b50da0b2f9 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 24 Oct 2023 00:30:25 -0400 Subject: [PATCH] fix(youtubedownloader): fixed how I was ordering the stream --- youtubedownloader/youtubedownloader.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/youtubedownloader/youtubedownloader.py b/youtubedownloader/youtubedownloader.py index 3460109..bebd916 100644 --- a/youtubedownloader/youtubedownloader.py +++ b/youtubedownloader/youtubedownloader.py @@ -67,10 +67,12 @@ class YouTubeDownloader(commands.Cog): yt = YouTube(url=url) filename = f"{yt.title} ({yt.video_id})" if audio_only: - stream = yt.streams.filter(only_audio=True, mime_type='audio/mp4').order_by('abr') + stream = yt.streams.filter(only_audio=True, mime_type='audio/mp4') + stream = stream.order_by('abr') filename_format = filename + ".m4a" else: - stream = yt.streams.filter(progressive=True, mime_type='video/mp4').order_by('res') + stream = yt.streams.filter(progressive=True, mime_type='video/mp4') + stream = stream.order_by('res') filename_format = filename + ".mp4" if os.path.isfile(path + f"{os.sep}{filename_format}"): previously_existed = True