diff --git a/botdiscord/translate.py b/botdiscord/translate.py index dde6df9..3aaab68 100644 --- a/botdiscord/translate.py +++ b/botdiscord/translate.py @@ -81,9 +81,10 @@ async def check_libretranslate_health(url: str) -> bool: _last_health_check = now try: - check_url = url.replace("/translate", "/languages") - if "/languages" not in check_url: - check_url = url.rstrip("/") + "/../languages" + from urllib.parse import urlparse, urlunparse + parsed = urlparse(url) + # Tomamos solo scheme + netloc y construimos /languages directamente + check_url = urlunparse((parsed.scheme, parsed.netloc, "/languages", "", "", "")) async with aiohttp.ClientSession() as session: async with session.get(check_url, timeout=10) as resp: if resp.status == 200: