From 0dbcfe3770b1df5f7d4d55062fcbb496eda49bc2 Mon Sep 17 00:00:00 2001 From: Denis Kartsev Date: Tue, 30 Dec 2025 04:45:56 +0300 Subject: [PATCH] removed crypt4 prefix panel api already returns a link with the prefix --- bot/utils/config_link.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bot/utils/config_link.py b/bot/utils/config_link.py index f18a342..c7f100c 100644 --- a/bot/utils/config_link.py +++ b/bot/utils/config_link.py @@ -4,8 +4,6 @@ from typing import Optional, Tuple from config.settings import Settings from bot.services.panel_api_service import PanelApiService -CRYPT4_PREFIX = "happ://crypt4/" - async def _encrypt_raw_link(settings: Settings, raw_link: str) -> Optional[str]: """Encrypt the raw subscription URL using the panel's happ crypt4 API.""" @@ -21,7 +19,7 @@ async def prepare_config_links(settings: Settings, raw_link: Optional[str]) -> T Build the user-facing connection key and the URL for the connect button. Returns (display_link, button_link). When CRYPT4 is enabled the display link - is encrypted and prefixed with happ://crypt4/, and the button link is wrapped + is encrypted and prefixed with happ://crypt4/ by panel API, and the button link is wrapped with CRYPT4_REDIRECT_URL if provided. """ if not raw_link: @@ -37,7 +35,7 @@ async def prepare_config_links(settings: Settings, raw_link: Optional[str]) -> T if settings.CRYPT4_ENABLED: encrypted_payload = await _encrypt_raw_link(settings, cleaned) if encrypted_payload: - display_link = f"{CRYPT4_PREFIX}{encrypted_payload}" + display_link = encrypted_payload button_link = display_link else: logging.error("CRYPT4_ENABLED is set but encryption failed; using raw link as fallback.")