Add paywall detection in post parser

This commit is contained in:
vvzvlad
2025-04-11 02:01:42 +03:00
parent c730d5bb7f
commit b59992cb22
+4
View File
@@ -320,6 +320,10 @@ class PostParser:
if re.search(r'(?i)(#реклама|#промо|О\s+рекламодателе|партнерский\s+пост|по\s+промокоду|erid|скидка\s+на\s+курс|регистрируйтесь\s+тут)', message_text):
flags.append("advert")
# Check for paywall-related words and tags
if re.search(r'(?i)(Дзен\.Премиум|Sponsr|Бусти|Boosty)', message_text):
flags.append("paywall")
# Check if the message contains any http/https links in text or href attributes
if re.search(r'https?://[^\s<>"\']+', message_text) or re.search(r'href=["\']https?://[^"\']+["\']', message_text):
flags.append("link")