Merge pull request #96 from PeanutSplash/main

fix-bug:修复抖音评论筛选
This commit is contained in:
relakkes 2023-12-14 00:57:17 +08:00 committed by GitHub
commit 40cbd9f4d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -196,8 +196,10 @@ class DOUYINClient:
# 在添加评论到结果列表之前进行关键字筛选
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