From c39b0207b0b3e017caa9d05b00d50353e01cdd2a Mon Sep 17 00:00:00 2001 From: Benny Date: Sun, 4 Aug 2024 10:35:55 +0200 Subject: [PATCH] fix download hook --- ytdlbot/downloader.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ytdlbot/downloader.py b/ytdlbot/downloader.py index c368736e..6844d5d6 100644 --- a/ytdlbot/downloader.py +++ b/ytdlbot/downloader.py @@ -114,12 +114,6 @@ def remove_bash_color(text): def download_hook(d: dict, bot_msg): - # since we're using celery, server location may be located in different region. - # Therefore, we can't trigger the hook very often. - # the key is user_id + download_link - original_url = d["info_dict"]["original_url"] - key = f"{bot_msg.chat.id}-{original_url}" - if d["status"] == "downloading": downloaded = d.get("downloaded_bytes", 0) total = d.get("total_bytes") or d.get("total_bytes_estimate", 0) @@ -136,6 +130,7 @@ def download_hook(d: dict, bot_msg): speed = remove_bash_color(d.get("_speed_str", "N/A")) eta = remove_bash_color(d.get("_eta_str", d.get("eta"))) text = tqdm_progress("Downloading...", total, downloaded, speed, eta) + # debounce in here edit_text(bot_msg, text)