Browse Source

修改了报警时间

luojunhui 1 month ago
parent
commit
c62d6233ef
2 changed files with 4 additions and 1 deletions
  1. 1 1
      app_config.toml
  2. 3 0
      applications/tasks/crawler_tasks/crawler_toutiao.py

+ 1 - 1
app_config.toml

@@ -3,4 +3,4 @@ bind = "0.0.0.0:6060"
 workers = 6
 keep_alive_timeout = 120  # 保持连接的最大秒数,根据需要调整
 graceful_timeout = 30    # 重启或停止之前等待当前工作完成的时间
-loglevel = "warning"  # 日志级别
+loglevel = "warning"  # 日志级别

+ 3 - 0
applications/tasks/crawler_tasks/crawler_toutiao.py

@@ -85,12 +85,14 @@ class CrawlerToutiao(CrawlerPipeline, CrawlerToutiaoConst):
             key="toutiao_blogger_cookie", output_type="string"
         )
         while has_more:
+            print(account_id, max_cursor)
             response = await get_toutiao_account_info_list(
                 account_id=account_id,
                 cookie=cookie,
                 media_type=media_type,
                 max_behot_time=current_cursor,
             )
+            print(response)
             if not response:
                 break
 
@@ -118,6 +120,7 @@ class CrawlerToutiao(CrawlerPipeline, CrawlerToutiaoConst):
                     raise Exception(f"unknown media type: {media_type}")
 
             crawler_info_list_bar = tqdm(info_list, desc=bar_description)
+            print(json.dumps(info_list, ensure_ascii=False, indent=4))
             for info in crawler_info_list_bar:
                 try:
                     crawler_info_list_bar.set_postfix({"id": info["id"]})