From 8fb5f1bee85043a3aadfb4789bb6ec6e5a95f3de Mon Sep 17 00:00:00 2001 From: phixxy Date: Wed, 4 Sep 2024 20:16:59 -0700 Subject: [PATCH] fixed cwd? hopefully --- cogs/ytdl.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cogs/ytdl.py b/cogs/ytdl.py index a485ce7..39185ca 100644 --- a/cogs/ytdl.py +++ b/cogs/ytdl.py @@ -16,9 +16,8 @@ class YoutubeDL(BotBaseCog): url = ctx.message.content.split(" ", 1)[1] url = '"' + url + '"' video_or_audio = ctx.message.content.split(" ", 2)[2] - process = subprocess.Popen(["python3", "data/ytdl/youtubedl.py", url, video_or_audio], cwd="data/ytdl/") - #process.wait() - #await ctx.send(process.stdout) + working_dir = f"{os.getcwd()}/data/ytdl/" + process = subprocess.Popen(["python3", "data/ytdl/youtubedl.py", url, video_or_audio], cwd=working_dir) await ctx.send(f"Downloading {video_or_audio} from {url}...", embeds=None) except: await ctx.send("Usage: !youtubedl ")