mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-24 03:54:20 +00:00
Fix weird bug with filenames
This commit is contained in:
parent
a3cffe1d74
commit
ef896ed3dc
1 changed files with 2 additions and 2 deletions
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue