From ef896ed3dc68aee505573ec2a94b2dad144e431e Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 8 Nov 2018 23:39:32 +0100 Subject: [PATCH] Fix weird bug with filenames --- discordbot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discordbot.py b/discordbot.py index 085e65b3..7319a2e2 100644 --- a/discordbot.py +++ b/discordbot.py @@ -139,7 +139,7 @@ class Video: if file is None and info is None: self.file = str(hash(url)) + ".opus" elif info is not None: - self.file = re.sub(r'[/\\?*"<>|!:]', "_", info["title"]) + ".opus" + self.file = "./opusfiles/" + re.sub(r'[/\\?*"<>|!:]', "_", info["title"]) + ".opus" else: self.file = file self.downloaded = False if file is None else True @@ -190,7 +190,7 @@ class Video: # Check if the file has been downloaded if not self.downloaded: raise FileNotDownloadedError() - return discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(f"./opusfiles/{self.file}", **ffmpeg_settings)) + return discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(f"{self.file}", **ffmpeg_settings)) class SecretVideo(Video):