fix(youtubedownloader): fixed how I was ordering the stream
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 52s

This commit is contained in:
Seaswimmer 2023-10-24 00:30:25 -04:00
parent 229aaa77d5
commit b45bddc548
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -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