Skip to content

Commit

Permalink
Post parser logic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
koval01 committed Nov 26, 2024
1 parent 194c11f commit 33f9a24
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/telegram/parser/types/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def text(buble: LexborNode) -> Union[dict, None]:
Returns:
Union[dict, None]: A dictionary containing text content, or None if no text found.
"""
selector = buble.css_first(".tgme_widget_message_text")
selector = buble.css_first(".tgme_widget_message_bubble>.tgme_widget_message_text")
if not selector:
return None

Expand Down Expand Up @@ -259,7 +259,9 @@ def reply(message: LexborNode) -> dict | None:
if not reply:
return None

text = reply.css_first(".tgme_widget_message_metatext")
text = reply.css_first(
".tgme_widget_message_metatext, .tgme_widget_message_text"
)
if not text:
return None

Expand Down

0 comments on commit 33f9a24

Please sign in to comment.