From b497ce6e66700ebf5a15698c93e80660c7381749 Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Thu, 27 Mar 2025 18:15:15 +0300 Subject: [PATCH] Add YouTube link title --- post_parser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/post_parser.py b/post_parser.py index bfbafb3..ecfe86c 100644 --- a/post_parser.py +++ b/post_parser.py @@ -127,6 +127,10 @@ class PostParser: # Check if the text contains only a URL and nothing else if text.strip(): + # Check for YouTube links + if re.search(r'(?:youtube\.com|youtu\.be)', text.lower()): + return "🎥 YouTube video" + # Remove all URLs from text text_without_urls = re.sub(r'https?://[^\s<>"\']+', '', text.strip()) if not text_without_urls: