fix(youtubedownloader): filter streams correctly
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
ff000db8fc
commit
549b626dda
1 changed files with 2 additions and 2 deletions
|
@ -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}"):
|
||||
|
|
Loading…
Reference in a new issue