diff --git a/bot/helper/mirror_leech_utils/download_utils/telegram_download.py b/bot/helper/mirror_leech_utils/download_utils/telegram_download.py index 21bbf879..7662df1c 100644 --- a/bot/helper/mirror_leech_utils/download_utils/telegram_download.py +++ b/bot/helper/mirror_leech_utils/download_utils/telegram_download.py @@ -60,10 +60,8 @@ class TelegramDownloadHelper: async def _on_download_error(self, error): async with global_lock: - try: + if self._id in GLOBAL_GID: GLOBAL_GID.remove(self._id) - except: - pass await self._listener.on_download_error(error) async def _on_download_complete(self): @@ -148,6 +146,9 @@ class TelegramDownloadHelper: await send_status_message(self._listener.message) await event.wait() if self._listener.is_cancelled: + async with global_lock: + if self._id in GLOBAL_GID: + GLOBAL_GID.remove(self._id) return await self._on_download_start(gid, add_to_queue)