From 0a9a7da8d44143ecde924d692729b4357b95a6d4 Mon Sep 17 00:00:00 2001 From: Patryk Mazur Date: Wed, 22 Apr 2026 20:46:15 +0200 Subject: [PATCH] Send cached V1.0.8 --- bot/utils/helpers.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bot/utils/helpers.py b/bot/utils/helpers.py index ff42043..29780da 100644 --- a/bot/utils/helpers.py +++ b/bot/utils/helpers.py @@ -36,11 +36,12 @@ def download_video(yt_url: str) -> dict: existing = [f for f in os.listdir(DOWNLOADS) if url_hash in f] if existing: - print(f'Znaleziono plik "{url_hash}" ({yt_url})') + print(f'Znaleziono plik "{existing[0]}" ({yt_url})') return { - "status": "success", - "filename": os.path.join(DOWNLOADS, existing[0]), - "cached": True, + 'status': 'success', + 'filename': os.path.join(DOWNLOADS, existing[0]), + 'title': {existing[0]}, + 'cached': True, } with yt_dlp.YoutubeDL({'quiet': True}) as ydl: @@ -65,7 +66,6 @@ def download_video(yt_url: str) -> dict: 'format': 'bestvideo+bestaudio/best', 'merge_output_format': 'mp4', 'outtmpl': os.path.join(DOWNLOADS, f'%(title)s_{url_hash}.%(ext)s'), - "no_overwrites": True, 'quiet': True, } @@ -83,5 +83,6 @@ def download_video(yt_url: str) -> dict: 'filename': filename, 'title': info.get('title'), 'duration': duration, + 'cached': False, 'url': yt_url, }