cold_start.py 663 B

123456789101112131415161718192021222324252627282930
  1. """
  2. @author: luojunhui
  3. """
  4. import json
  5. from applications import aiditApi
  6. from config import apolloConfig
  7. config = apolloConfig()
  8. sensitive_word_list = json.loads(config.getConfigValue("sensitive_word_list"))
  9. def whether_title_sensitive(title: str) -> bool:
  10. """
  11. : param title:
  12. 判断视频是否的标题是否包含敏感词
  13. """
  14. for word in sensitive_word_list:
  15. if word in title:
  16. return True
  17. return False
  18. def get_inner_account_set() -> set:
  19. """
  20. get inner account set
  21. """
  22. accounts = aiditApi.get_publish_account_from_aigc()
  23. gh_id_list = [i['ghId'] for i in accounts]
  24. return set(gh_id_list)