From 4b7481091270e726c7155eac226ac4a45f4a52fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Kr=C4=8Dek?= Date: Tue, 6 May 2025 20:24:22 +0200 Subject: [PATCH] Remove logging and duplicate videos --- telegram_downloader_bot/utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/telegram_downloader_bot/utils.py b/telegram_downloader_bot/utils.py index 43fea4f..181573e 100644 --- a/telegram_downloader_bot/utils.py +++ b/telegram_downloader_bot/utils.py @@ -129,9 +129,6 @@ async def save_tt_hashes(hashes: set) -> None: async def check_if_tt_downloaded(tt_hash: str) -> bool: all_tt_hashes = await get_tt_hashes() - log.info(f"All hashes: {all_tt_hashes}") - log.info(f"Hash to check: {tt_hash}") - log.info(f"Hash exists: {tt_hash in all_tt_hashes}") return tt_hash in all_tt_hashes @@ -153,9 +150,9 @@ async def download_tt_video(url: str) -> str: log.info(f"{video_hash}") log.info(f"{video_filepath}") - print(video_filepath) if await check_if_tt_downloaded(video_hash) is True: + os.remove(video_filepath) return "Already downloaded" with open(video_filepath, "wb") as f: