|
@@ -13,16 +13,14 @@ from common.feishu import Feishu
|
|
|
|
|
|
|
|
|
def main(log_type, crawler, strategy, oss_endpoint, env, machine):
|
|
|
- while True:
|
|
|
- try:
|
|
|
- Common.logger(log_type, crawler).info('开始抓取 西瓜视频 定向榜\n')
|
|
|
- Follow.get_follow_videos(log_type, crawler, strategy, oss_endpoint, env, machine)
|
|
|
- Common.del_logs(log_type, crawler)
|
|
|
- Common.logger(log_type, crawler).info('抓取完一轮,休眠 1 分钟\n')
|
|
|
- time.sleep(60)
|
|
|
- except Exception as e:
|
|
|
- Common.logger(log_type, crawler).info(f"西瓜视频异常,触发报警:{e}\n")
|
|
|
- Feishu.bot(log_type, crawler, f"{e}")
|
|
|
+ try:
|
|
|
+ Common.logger(log_type, crawler).info('开始抓取 西瓜视频 定向榜\n')
|
|
|
+ Follow.get_follow_videos(log_type, crawler, strategy, oss_endpoint, env, machine)
|
|
|
+ Common.del_logs(log_type, crawler)
|
|
|
+ Common.logger(log_type, crawler).info('抓取完一轮,休眠 1 分钟\n')
|
|
|
+ except Exception as e:
|
|
|
+ Common.logger(log_type, crawler).info(f"西瓜视频异常,触发报警:{e}\n")
|
|
|
+ Feishu.bot(log_type, crawler, f"{e}")
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|