fix(youtubedownloader): fixed how I was ordering the stream
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 52s
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 52s
This commit is contained in:
parent
229aaa77d5
commit
b45bddc548
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue