changed working dir and blocking

This commit is contained in:
phixxy 2024-09-04 20:08:07 -07:00
parent 3d2b15510f
commit 80b00b3aea

View file

@ -16,9 +16,9 @@ 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])
process.wait()
await ctx.send(process.stdout)
process = subprocess.Popen(["python3", "data/ytdl/youtubedl.py", url, video_or_audio], cwd="data/ytdl/")
#process.wait()
#await ctx.send(process.stdout)
await ctx.send(f"Downloading {video_or_audio} from {url}...", embeds=None)
except:
await ctx.send("Usage: !youtubedl <url> <video|audio>")