本地词库 + 每日自动更新,无需 API Key,离线可用。
scripts/
check.py # 主检测脚本(入口)
update_words.py # 词库更新模块(每天首次自动触发)
data/ # 运行时生成,词库缓存目录(.gitignore 排除)
sensitive_words.txt
.update_state.json
SKILL=~/.agents/skills/douyin-sensitive-check
# 检测一段文案
python3 $SKILL/scripts/check.py "今天给大家推荐史上最好用的护肤品,加我微信领优惠券"
# 检测文件
python3 $SKILL/scripts/check.py -f /path/to/script.txt
# 管道
echo "文案内容" | python3 $SKILL/scripts/check.py
# 强制更新词库
python3 $SKILL/scripts/check.py --update
# 查看词库状态
python3 $SKILL/scripts/check.py --status
update_words.py 从 3 个 GitHub 开源词库拉取最新内容合并data/sensitive_words.txt(去重合并,含数万词条)konsheng/Sensitive-lexicon:广告、政治、暴恐、色情、涉枪涉爆、补充词库bigdata-labs/sensitive-stop-words:广告、政治、色情、涉枪涉爆jkiss/sensitive-words:广告、政治、色情data/.update_state.json 记录最后更新日期--updatecheck.py 的 CATEGORY_PATTERNS 中补充data/sensitive_words.txt 删除误报词共 1 个版本