From b237789f4bddc38acc777a0082c73497586dc95d Mon Sep 17 00:00:00 2001 From: Patryk Mazur Date: Wed, 22 Apr 2026 20:19:15 +0200 Subject: [PATCH] Verbosity V1.0.6 --- bot/__init__.py | 2 +- bot/cogs/mateusz.py | 3 ++- bot/utils/helpers.py | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bot/__init__.py b/bot/__init__.py index 2f280c3..9d94baa 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -1,6 +1,6 @@ import discord -__version__ = '1.0.4' +__version__ = '1.0.5' __author__ = 'Kartoniarz' diff --git a/bot/cogs/mateusz.py b/bot/cogs/mateusz.py index 59d6f46..bdf336a 100644 --- a/bot/cogs/mateusz.py +++ b/bot/cogs/mateusz.py @@ -16,8 +16,9 @@ class Simp(commands.Cog): if result['status'] == 'error': await ctx.respond(f'Błąd pobierania: {result["message"]}') return - + print(f'Wysyłanie {result["title"]} na kanał {ctx.channel.name} ({ctx.guild.name})') await ctx.respond(file=discord.File(result['filename'])) + print(f'Wysyłano {result["title"]} na kanał {ctx.channel.name} ({ctx.guild.name})') def setup(bot: discord.Bot): diff --git a/bot/utils/helpers.py b/bot/utils/helpers.py index 3fffcab..f36d8d8 100644 --- a/bot/utils/helpers.py +++ b/bot/utils/helpers.py @@ -35,12 +35,15 @@ def download_video(yt_url: str) -> dict: with yt_dlp.YoutubeDL({'quiet': True}) as ydl: try: + print(f'Pobieranie {yt_url}') info = ydl.extract_info(yt_url, download=False) except Exception as e: + print(f'Nie można pobrać metadanych: {e}') return {'status': 'error', 'message': f'Nie można pobrać metadanych: {e}'} duration = info.get('duration', 0) if duration > MAX_DUR: + print(f'Wideo jest za długie ({duration // 60}m {duration % 60}s). Maksymalnie {MAX_DUR // 60}m {MAX_DUR % 60}s.') return { 'status': 'error', 'message': f'Wideo jest za długie ({duration // 60}m {duration % 60}s). Maksymalnie {MAX_DUR // 60}m {MAX_DUR % 60}s.' @@ -58,10 +61,9 @@ def download_video(yt_url: str) -> dict: with yt_dlp.YoutubeDL(ydl_opts) as ydl: try: - print(f'Pobieranie {yt_url}') info = ydl.extract_info(yt_url, download=True) filename = ydl.prepare_filename(info) - print(f'Pobrano {yt_url}') + print(f'Pobrano {filename} ({yt_url})') except Exception as e: print(f'Błąd pobierania: {e}') return {'status': 'error', 'message': f'Błąd pobierania: {e}'}