Skip to content

Commit

Permalink
Merge pull request #96 from PeanutSplash/main
Browse files Browse the repository at this point in the history
fix-bug:修复抖音评论筛选
  • Loading branch information
NanmiCoder authored Dec 13, 2023
2 parents c4d68f8 + 5c6a636 commit 40cbd9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions media_platform/douyin/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ async def get_aweme_all_comments(

# 在添加评论到结果列表之前进行关键字筛选
if keywords:
filtered_comments = [comment for comment in comments if
not any(keyword in comment.get("text", "") for keyword in keywords)]
filtered_comments = []
for comment in comments:
if any(keyword in comment.get("text", "") for keyword in keywords):
filtered_comments.append(comment)
else:
filtered_comments = comments

Expand Down

0 comments on commit 40cbd9f

Please sign in to comment.