From a2ff793a94f13f28093233c24bc82f4fe60ab26d Mon Sep 17 00:00:00 2001 From: 5hojib Date: Fri, 31 Jan 2025 16:18:15 +0600 Subject: [PATCH] update --- .python-version | 2 +- Dockerfile | 2 +- bot/helper/listeners/jdownloader_listener.py | 2 +- bot/helper/mirror_leech_utils/download_utils/jd_download.py | 2 +- .../mirror_leech_utils/status_utils/jdownloader_status.py | 6 +++--- bot/helper/telegram_helper/message_utils.py | 2 +- myjd/__init__.py | 1 + 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.python-version b/.python-version index fdcfcfdfc..3a4f41ef3 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.12 \ No newline at end of file +3.13 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index ea7ac8658..5ff0c0e01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM 5hojib/aeon:beta +FROM 5hojib/aeon:latest WORKDIR /usr/src/app RUN chmod 777 /usr/src/app diff --git a/bot/helper/listeners/jdownloader_listener.py b/bot/helper/listeners/jdownloader_listener.py index 9af2bbd8c..6700f9920 100644 --- a/bot/helper/listeners/jdownloader_listener.py +++ b/bot/helper/listeners/jdownloader_listener.py @@ -53,7 +53,7 @@ async def _jd_listener(): packages = await jdownloader.device.downloads.query_packages( [{"finished": True, "saveTo": True}], ) - except: + except Exception: continue all_packages = {pack["uuid"]: pack for pack in packages} diff --git a/bot/helper/mirror_leech_utils/download_utils/jd_download.py b/bot/helper/mirror_leech_utils/download_utils/jd_download.py index 315ffe37e..f62e8dad8 100644 --- a/bot/helper/mirror_leech_utils/download_utils/jd_download.py +++ b/bot/helper/mirror_leech_utils/download_utils/jd_download.py @@ -63,7 +63,7 @@ async def _event_handler(self): ) try: await wait_for(self.event.wait(), timeout=self._timeout) - except: + except Exception: await edit_message(self._reply_to, "Timed Out. Task has been cancelled!") self.listener.is_cancelled = True self.event.set() diff --git a/bot/helper/mirror_leech_utils/status_utils/jdownloader_status.py b/bot/helper/mirror_leech_utils/status_utils/jdownloader_status.py index 3248d0f07..d53fa251b 100644 --- a/bot/helper/mirror_leech_utils/status_utils/jdownloader_status.py +++ b/bot/helper/mirror_leech_utils/status_utils/jdownloader_status.py @@ -31,7 +31,7 @@ def _get_combined_info(result, old_info): time() - old_info.get("last_update", 0) ) eta = (bytesTotal - bytesLoaded) / speed - except: + except Exception: eta = 0 return { "name": name, @@ -64,7 +64,7 @@ async def get_download(gid, old_info): ], ) return _get_combined_info(result, old_info) if len(result) > 1 else result[0] - except: + except Exception: return old_info @@ -80,7 +80,7 @@ async def _update(self): def progress(self): try: return f"{round((self._info.get('bytesLoaded', 0) / self._info.get('bytesTotal', 0)) * 100, 2)}%" - except: + except Exception: return "0%" def processed_bytes(self): diff --git a/bot/helper/telegram_helper/message_utils.py b/bot/helper/telegram_helper/message_utils.py index 6fce739a7..b09a1e3c0 100644 --- a/bot/helper/telegram_helper/message_utils.py +++ b/bot/helper/telegram_helper/message_utils.py @@ -286,7 +286,7 @@ async def get_tg_link_message(link, user_id=""): raise TgLinkException("We don't have access to this chat!") from e if not user_message.empty: return (links, user_session) if links else (user_message, user_session) - return None + return None, None raise TgLinkException("Private: Please report!") diff --git a/myjd/__init__.py b/myjd/__init__.py index 9f6b5e8f6..d28d33b73 100644 --- a/myjd/__init__.py +++ b/myjd/__init__.py @@ -37,6 +37,7 @@ __version__ = "1.1.7" __all__ = [ + "MyJdApi", "MYJDApiCommandNotFoundException", "MYJDApiException", "MYJDApiInterfaceNotFoundException",