zhongqingkandian_recommend.py 753 B

1234567891011121314151617181920212223
  1. import asyncio
  2. from spiders.basespider import BaseSpider
  3. from spiders.recommendspider import RecommendSpider
  4. class ZhongqingkandianRecommend(RecommendSpider):
  5. async def custom_start_checks(self) -> bool:
  6. """自定义启动检查"""
  7. self.logger.info("愿你福气满满爬虫启动检查通过")
  8. return True
  9. async def main():
  10. rule_dict = {'videos_cnt': {'min': 1500, 'max': 0}, 'duration': {'min': 30, 'max': 1200}}
  11. user_list = [{"uid": 81522822, "link": "中青看点推荐", "nick_name": "免不了俗"}]
  12. trace_id = "yuannifuqimanman_202507021200"
  13. bszf = ZhongqingkandianRecommend(rule_dict, user_list, trace_id)
  14. await bszf.run()
  15. if __name__ == '__main__':
  16. asyncio.run(main()) # 异步入口