From 1399ebca7b34e422edbac7c65c41a3b0d4d4a692 Mon Sep 17 00:00:00 2001 From: Phixxy Date: Wed, 4 Sep 2024 23:15:02 -0700 Subject: [PATCH] re-enable upload to litterbox --- cogs/ytdl.py | 8 ++++---- data/ytdl/youtubedl.py | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cogs/ytdl.py b/cogs/ytdl.py index 41c4286..c068872 100644 --- a/cogs/ytdl.py +++ b/cogs/ytdl.py @@ -36,12 +36,12 @@ class YoutubeDL(BotBaseCog): stdout, stderr = process.communicate() # Send the output back to the user - await ctx.send(f"std out: {stdout.decode('utf-8')}") if stdout else await ctx.send("No stdout output") - await ctx.send(f"std err: {stderr.decode('utf-8')}") if stderr else await ctx.send("No stderr output") + #await ctx.send(f"std out: {stdout.decode('utf-8')}") if stdout else await ctx.send("No stdout output") + #await ctx.send(f"std err: {stderr.decode('utf-8')}") if stderr else await ctx.send("No stderr output") await ctx.send(f"Downloading {video_or_audio} from {url}...", suppress_embeds=True) except Exception as e: - await ctx.send(f"Error: {e}") + #await ctx.send(f"Error: {e}") await ctx.send("Usage: !youtubedl ") #create a task @@ -52,7 +52,7 @@ class YoutubeDL(BotBaseCog): with open(f"data/ytdl/{file}", "r") as f: url = f.read() await self.bot.get_channel(544408659174883328).send(f"{url}") - #os.remove(f"data/ytdl/{file}") + os.remove(f"data/ytdl/{file}") async def setup(bot): await bot.add_cog(YoutubeDL(bot)) \ No newline at end of file diff --git a/data/ytdl/youtubedl.py b/data/ytdl/youtubedl.py index 6caf167..6f594aa 100644 --- a/data/ytdl/youtubedl.py +++ b/data/ytdl/youtubedl.py @@ -42,8 +42,7 @@ def main(): print(url, video_or_audio) if download(url, video_or_audio): zip_file = zip_all_files() - #output_url = upload_to_litterbox(zip_file) - output_url = "test_url" + output_url = upload_to_litterbox(zip_file) print(output_url) with open(f"{time.time()}.txt", "w") as output_file: output_file.write(output_url)