diff --git a/post_parser.py b/post_parser.py index 4975577..07d6a21 100644 --- a/post_parser.py +++ b/post_parser.py @@ -490,6 +490,7 @@ class PostParser: 'reactions': self._extract_reactions(message), 'media_group_id': message.media_group_id, 'service': getattr(message, "service", None), + 'show_caption_above_media': getattr(message, 'show_caption_above_media', False), 'raw_message': str(message) } @@ -604,18 +605,29 @@ class PostParser: media_html = self._generate_html_media(message) content_body.append(f'
') - if forward_html: + if forward_html: content_body.append(forward_html) # Forward info content_body.append("
") - if reply_html: + if reply_html: content_body.append(reply_html) # Reply info content_body.append("
") - if text_html: - content_body.append(text_html) # Post text - content_body.append("
") + + show_caption_above = getattr(message, 'show_caption_above_media', False) - content_body.append(media_html) # Media - content_body.append("
") + if show_caption_above: + if media_html: + content_body.append(media_html) + content_body.append("
") + if text_html: + content_body.append(text_html) + content_body.append("
") + else: + if text_html: + content_body.append(text_html) + content_body.append("
") + if media_html: + content_body.append(media_html) + content_body.append("
") if poll_html: content_body.append(poll_html) # Poll if message.forward_origin: content_body.append(f"--- Forwarded post end ---") # Forward info end