From 936ffa8b06f339de37f6246e45858bbd215cd204 Mon Sep 17 00:00:00 2001 From: Samlon Date: Mon, 11 Aug 2025 18:08:59 +0200 Subject: more logs!?!?! and fixes --- cogs/compression.py | 2 +- cogs/downloader.py | 1 + cogs/math.py | 2 +- cogs/music/join.py | 3 ++- cogs/music/play.py | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cogs/compression.py b/cogs/compression.py index 75eaf7c..dc8e632 100644 --- a/cogs/compression.py +++ b/cogs/compression.py @@ -52,7 +52,7 @@ class Compression(commands.Cog): # Execute ffmpeg command to compress video ffmpeg_command = f"ffmpeg -i {input_path} -c:v libx264 -crf 51 -b:v 100 -vf 'fps=10' -preset ultrafast -c:a libopus -b:a 500 {output_path}" elif file_type == "Audio": - ffmpeg_command = f"ffmpeg -i {input_path} -ar 8000 -ac 1 -b:a 16k -acodec libmp3lame -q:a 9 {output_path}" + ffmpeg_command = f"ffmpeg -i {input_path} -ac 1 -b:a 500 -acodec libopus {output_path}" elif file_type == "Image": # Use ImageMagick's magick to heavily compress image (JPEG/PNG/GIF) # For JPEG: quality 5, strip metadata, resize to 30% of the original size diff --git a/cogs/downloader.py b/cogs/downloader.py index 9f825b4..7b338e9 100644 --- a/cogs/downloader.py +++ b/cogs/downloader.py @@ -28,6 +28,7 @@ class Downloader(commands.Cog): ): await ctx.defer() try: + logger.info(f"Downloading {url}") # Create a temporary directory with tempfile.TemporaryDirectory() as temp_dir: # Configure yt-dlp to use the temp directory diff --git a/cogs/math.py b/cogs/math.py index 123d7d0..8a2644c 100644 --- a/cogs/math.py +++ b/cogs/math.py @@ -17,7 +17,7 @@ class Math(commands.Cog): ) async def math(self, ctx: ApplicationContext, equation: str): try: - math = subprocess.check_output(f"qalc -e {equation}", shell=True) + math = subprocess.check_output(f"qalc -e '{equation}'", shell=True) await ctx.respond(f"{equation} = {math.decode('utf-8').strip()}") logger.info(f"Math command executed: {equation}") except Exception as e: diff --git a/cogs/music/join.py b/cogs/music/join.py index c626897..9837fdb 100644 --- a/cogs/music/join.py +++ b/cogs/music/join.py @@ -11,7 +11,8 @@ class Join(commands.Cog): @commands.slash_command(name="join", description="dołącza do kanalu") async def join(self, ctx): - await ctx.voice_client.connect() + channel = ctx.author.voice.channel + await channel.connect() logger.info("Bot connected to voice channel") diff --git a/cogs/music/play.py b/cogs/music/play.py index e75c91f..cf04ded 100644 --- a/cogs/music/play.py +++ b/cogs/music/play.py @@ -85,7 +85,7 @@ class Play(commands.Cog): if not result['result']: await ctx.followup.send("nie znaleziono wideo dla twojego wyszukiwania.", ephemeral=True) - logger.info(f"Could not find a video for your search: {search}") + logger.info(f"Could not find a video for search: {search}") return video = result['result'][0] -- cgit v1.2.3