Commit 1300619

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-01-22 14:28:04
fix: fix some config var
1 parent d76d8a6
Changed files (3)
src/bridge/ocr.py
@@ -20,7 +20,7 @@ async def send_to_ocr_bridge(client: Client, message: Message, **kwargs):
 
     See docs in `bridge/README.md` for details.
     """
-    if not ENABLE.WGET:
+    if not ENABLE.OCR:
         return
     # send docs if message == "/ocr", without reply
     if equal_prefix(message.text, prefix=[PREFIX.OCR]) and not message.reply_to_message:
src/others/extract_audio.py
@@ -6,7 +6,7 @@ from loguru import logger
 from pyrogram.client import Client
 from pyrogram.types import Message, ReplyParameters
 
-from config import PREFIX, cache
+from config import ENABLE, PREFIX, cache
 from message_utils import equal_prefix, modify_progress, parse_msg, send2tg, startswith_prefix
 from multimedia import convert_to_audio, parse_media_info
 
@@ -23,6 +23,8 @@ HELP = f"""
 @cache.memoize(ttl=60)
 async def extract_audio_file(client: Client, message: Message, **kwargs) -> None:
     """Extract audio from video message."""
+    if not ENABLE.AUDIO:
+        return
     # send docs if message == "/audio", without reply
     if equal_prefix(message.text, prefix=[PREFIX.AUDIO]) and not message.reply_to_message:
         await send2tg(client, message, texts=HELP, **kwargs)
src/config.py
@@ -27,11 +27,9 @@ class ENABLE:
     GPT = os.getenv("ENABLE_GPT", "1").lower() in ["1", "y", "yes", "t", "true", "on"]
     INSTAGRAM = os.getenv("ENABLE_INSTAGRAM", "1").lower() in ["1", "y", "yes", "t", "true", "on"]
     OCR = os.getenv("ENABLE_OCR", "1").lower() in ["1", "y", "yes", "t", "true", "on"]
-    SPLITIMG = os.getenv("ENABLE_SPLITIMG", "1").lower() in ["1", "y", "yes", "t", "true", "on"]
     SUBTITLE = os.getenv("ENABLE_SUBTITLE", "1").lower() in ["1", "y", "yes", "t", "true", "on"]
     TIKTOK = os.getenv("ENABLE_TIKTOK", "1").lower() in ["1", "y", "yes", "t", "true", "on"]
     TWITTER = os.getenv("ENABLE_TWITTER", "1").lower() in ["1", "y", "yes", "t", "true", "on"]
-    VIDEO_TO_AUDIO = os.getenv("ENABLE_VIDEO_TO_AUDIO", "1").lower() in ["1", "y", "yes", "t", "true", "on"]
     WEIBO = os.getenv("ENABLE_WEIBO", "1").lower() in ["1", "y", "yes", "t", "true", "on"]
     WGET = os.getenv("ENABLE_WGET", "1").lower() in ["1", "y", "yes", "t", "true", "on"]
     XHS = os.getenv("ENABLE_XHS", "1").lower() in ["1", "y", "yes", "t", "true", "on"]