fix(youtubedownlaoder): hopefully fixed downloading videos
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 53s
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 53s
This commit is contained in:
parent
b45bddc548
commit
1d666a569c
1 changed files with 2 additions and 2 deletions
|
@ -72,13 +72,13 @@ class YouTubeDownloader(commands.Cog):
|
||||||
filename_format = filename + ".m4a"
|
filename_format = filename + ".m4a"
|
||||||
else:
|
else:
|
||||||
stream = yt.streams.filter(progressive=True, mime_type='video/mp4')
|
stream = yt.streams.filter(progressive=True, mime_type='video/mp4')
|
||||||
stream = stream.order_by('res')
|
stream = stream.order_by('resolution')
|
||||||
filename_format = filename + ".mp4"
|
filename_format = filename + ".mp4"
|
||||||
if os.path.isfile(path + f"{os.sep}{filename_format}"):
|
if os.path.isfile(path + f"{os.sep}{filename_format}"):
|
||||||
previously_existed = True
|
previously_existed = True
|
||||||
else:
|
else:
|
||||||
previously_existed = False
|
previously_existed = False
|
||||||
return stream.first().download(filename=filename, output_path=path), previously_existed, filename_format
|
return stream.desc().first().download(filename=filename, output_path=path), previously_existed, filename_format
|
||||||
data_path = await self.config.save_directory()
|
data_path = await self.config.save_directory()
|
||||||
if subfolder and await self.bot.is_owner(ctx.author):
|
if subfolder and await self.bot.is_owner(ctx.author):
|
||||||
data_path = os.path.join(data_path, subfolder)
|
data_path = os.path.join(data_path, subfolder)
|
||||||
|
|
Loading…
Reference in a new issue