From 1014e4a0d9465a89eed5a85ae25b443ebce2f8aa Mon Sep 17 00:00:00 2001 From: Ghytro Date: Thu, 7 Nov 2024 17:03:58 +0300 Subject: [PATCH] more simple url processing --- bot/msgprocessor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/msgprocessor.py b/bot/msgprocessor.py index ecf6b99..2bce944 100644 --- a/bot/msgprocessor.py +++ b/bot/msgprocessor.py @@ -33,8 +33,8 @@ class TrackerRemovalMsgProcessor: # но ссылка может быть и без указания схемы, телега может распарсить # просто строку через точки и в конце какой то домен верхнего уровня как ссылку def is_url(url: str) -> bool: - SCHEME = "http://" - return url.startswith(SCHEME) + SCHEMES = ["http://", "https://"] + return len([s for s in SCHEMES if url.startswith(s)]) != 0 lexems = self.__msg.text.split() for i, l in enumerate(lexems):