1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Fix weird bug with filenames

This commit is contained in:
Steffo 2018-11-08 23:39:32 +01:00
parent a3cffe1d74
commit ef896ed3dc

View file

@ -139,7 +139,7 @@ class Video:
if file is None and info is None: if file is None and info is None:
self.file = str(hash(url)) + ".opus" self.file = str(hash(url)) + ".opus"
elif info is not None: elif info is not None:
self.file = re.sub(r'[/\\?*"<>|!:]', "_", info["title"]) + ".opus" self.file = "./opusfiles/" + re.sub(r'[/\\?*"<>|!:]', "_", info["title"]) + ".opus"
else: else:
self.file = file self.file = file
self.downloaded = False if file is None else True self.downloaded = False if file is None else True
@ -190,7 +190,7 @@ class Video:
# Check if the file has been downloaded # Check if the file has been downloaded
if not self.downloaded: if not self.downloaded:
raise FileNotDownloadedError() 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): class SecretVideo(Video):