Enhance video flag detection to include animation media type in post parsing

This commit is contained in:
vvzvlad
2025-03-21 14:18:46 +03:00
parent 6be312235c
commit 6ee4cc7237
+3 -2
View File
@@ -206,8 +206,9 @@ class PostParser:
getattr(message, "forward_sender_name", None)):
flags.append("fwd")
# Add flag "video" if the message media is VIDEO and the body text is up to 100 characters.
if message.media == MessageMediaType.VIDEO and len(message_text.strip()) <= 100:
# Add flag "video" if the message media is VIDEO or ANIMATION and the body text is up to 100 characters.
if (message.media in [MessageMediaType.VIDEO, MessageMediaType.ANIMATION] and
len(message_text.strip()) <= 100):
flags.append("video")
# Add flag for posts without images