Commit 41956df
Changed files (8)
src
src/messages/sender.py
@@ -154,7 +154,7 @@ async def send_texts(
if not msg:
continue
# we do not send comments-only texts
- if (f"{BLOCKQUOTE_EXPANDABLE_DELIM}💬" in msg or f"{BLOCKQUOTE_DELIM}💬" in msg) and "💬**点此展开评论区**:" not in msg:
+ if (f"{BLOCKQUOTE_EXPANDABLE_DELIM}💬" in msg or f"{BLOCKQUOTE_DELIM}💬" in msg or "<b>💬" in msg) and "点击展开评论" not in msg:
continue
if idx != 0:
reply_parameters = None
src/preview/bilibili.py
@@ -267,7 +267,7 @@ async def get_bilibili_comments(url_or_vid: int | str) -> list[str]:
location = f"({location})" if location else ""
if cmt := glom(x, "content.message", default=""):
if idx == 0:
- comments_list.append("💬**点此展开评论区**:")
+ comments_list.append("💬**点击展开评论**:")
cmt = f"💬**{name}**{location}: {emojify(cmt)}"
comments_list.append(f"\n{cmt}")
except Exception as e:
src/preview/douyin.py
@@ -314,7 +314,7 @@ async def get_comments(aweme_id: str = "", platform: str = "douyin", douyin_comm
comments_str = ""
for idx, cmt in enumerate(comments):
if idx == 0:
- comments_str += "💬**点此展开评论区**:"
+ comments_str += "💬**点击展开评论**:"
comments_str += f"\n💬**{cmt['name']}**{cmt['region']}: {cmt['text']}"
return blockquote(comments_str)
src/preview/instagram.py
@@ -119,7 +119,7 @@ async def preview_instagram(
comment_nodes = sorted(comment_nodes, key=lambda x: glom(x, "node.created_at", default=0))
for idx, node in enumerate(comment_nodes):
if idx == 0:
- comments += "💬**点此展开评论区**:"
+ comments += "💬**点击展开评论**:"
author = glom(node, "node.owner.username", default="user")
cmt = glom(node, "node.text", default="")
comments += f"\n💬**[{author}](https://www.instagram.com/{author})**: {cmt}"
src/preview/reddit.py
@@ -86,7 +86,7 @@ async def get_reddit_info(url: str, **kwargs) -> dict:
continue
comments += f"\n💬**[{author}]({author_url})**: {comment}"
if comments:
- comments = blockquote(f"💬**点此展开评论区**:{comments}")
+ comments = blockquote(f"💬**点击展开评论**:{comments}")
await modify_progress(text=f"⏬正在下载:\n{summay_media(media)}", force_update=True, **kwargs)
media = await download_media(media, **kwargs)
except Exception as e:
src/preview/twitter.py
@@ -356,7 +356,7 @@ async def get_comments(post_id: int, *, twitter_comments: bool = True) -> list[s
if text := glom(reply, Coalesce("text", "raw_text.text"), default=""):
comments.append(f'<a href="{tweet_url}"><b>💬{author}:</b></a> {clean_handle(text)}')
if comments:
- comments.insert(0, "<b>💬点此展开评论区:</b>")
+ comments.insert(0, "<b>💬点击展开评论:</b>")
return comments
src/preview/weibo.py
@@ -316,7 +316,7 @@ async def parse_weibo_comments(post_id: str) -> str:
cmt = emojify(cmt)
comments += f"\n{cmt}"
if comments:
- comments = f"\n{'💬**点此展开评论区**:'}{comments}"
+ comments = f"\n{'💬**点击展开评论**:'}{comments}"
return blockquote(comments.strip())
src/preview/youtube.py
@@ -39,7 +39,7 @@ async def get_youtube_comments(vid: str | None) -> list[str]:
name = f"[{name}]({author_url})"
if cmt := glom(x, "snippet.topLevelComment.snippet.textDisplay", default=""):
if idx == 0:
- comments_list.append("💬**点此展开评论区**:")
+ comments_list.append("💬**点击展开评论**:")
comments_list.append(f"\n💬**{name}**: {cmt}")
except Exception as e:
logger.error(f"Failed to get YouTube comments: {e}")