From 5af7f3f646b5c61e094450ea1aeaca15a71ad13a Mon Sep 17 00:00:00 2001 From: "nikita (Netherlands VDS)" Date: Fri, 9 Jan 2026 01:12:49 +0300 Subject: [PATCH] Mods update * Fixed notifications not working in mod_chat_sanitizer (in violent sanitization) * Increased default timeouts for _get_all_quantites and _download_video (mod_video_downloader) --- mod_chat_sanitizer.py | 1 + mod_video_downloader.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mod_chat_sanitizer.py b/mod_chat_sanitizer.py index f1410d1..be921b4 100644 --- a/mod_chat_sanitizer.py +++ b/mod_chat_sanitizer.py @@ -98,6 +98,7 @@ async def _violent_worker(data: dict) -> None: await client.send_message(report_peer, message='mod_chat_sanitizer:\n\nLooks like no new messages. Stopping... Offset: %s' % messages_offset) to_work = False break + notify_in -= len(res) for i in range(len(res)): try: # check if text is forbidden diff --git a/mod_video_downloader.py b/mod_video_downloader.py index a0dd123..fba0210 100644 --- a/mod_video_downloader.py +++ b/mod_video_downloader.py @@ -98,14 +98,14 @@ def _get_all_qualities_raw(url: str, proxy: bool, timeout: float = 20) -> dict | except: return traceback.format_exc() -async def _get_all_qualities(url: str, proxy: bool, timeout: float = 20) -> dict | str: +async def _get_all_qualities(url: str, proxy: bool, timeout: float = 60) -> dict | str: ''' Async version ''' try: return await asyncio.to_thread(_get_all_qualities_raw, url, proxy, timeout) except: return traceback.format_exc() -def _download_video_raw(url: str, quality_code : str, path: str, proxy: bool, timeout: float = 20) -> str | bool: +def _download_video_raw(url: str, quality_code : str, path: str, proxy: bool, timeout: float = 60) -> str | bool: ''' Download video from URL, use quality code to get info from cache ''' try: # no such quality cached @@ -175,7 +175,7 @@ def _download_video_raw(url: str, quality_code : str, path: str, proxy: bool, ti except: return traceback.format_exc() -async def _download_video(url: str, quality_code : str, path: str, proxy: bool, timeout: float = 20) -> str | bool: +async def _download_video(url: str, quality_code : str, path: str, proxy: bool, timeout: float = 60) -> str | bool: ''' Async version ''' try: return await asyncio.to_thread(_download_video_raw, url, quality_code, path, proxy, timeout)