more simple url processing

This commit is contained in:
Ghytro
2024-11-07 17:03:58 +03:00
parent 9d90726813
commit 1014e4a0d9

View File

@ -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):