Преглед на файлове

Merge branch 'feature/luojunhui/20251208-add-token-to-blogger' of Server/LongArticleTaskServer into master

luojunhui преди 3 месеца
родител
ревизия
1ea05be5d4
променени са 1 файла, в които са добавени 8 реда и са изтрити 2 реда
  1. 8 2
      applications/crawler/wechat/gzh_spider.py

+ 8 - 2
applications/crawler/wechat/gzh_spider.py

@@ -10,7 +10,7 @@ from applications.api import log
 from applications.utils import request_retry
 from applications.utils import AsyncHttpClient
 
-retry_desc = request_retry(retry_times=3, min_retry_delay=2, max_retry_delay=30)
+retry_desc = request_retry(retry_times=3, min_retry_delay=2, max_retry_delay=16)
 
 # url from aigc
 base_url = "http://crawler-cn.aiddit.com/crawler/wei_xin"
@@ -51,7 +51,13 @@ async def get_article_detail(
 @retry(**retry_desc)
 async def get_article_list_from_account(account_id: str, index=None) -> dict | None:
     target_url = f"{base_url}/blogger"
-    payload = json.dumps({"account_id": account_id, "cursor": index})
+    payload = json.dumps(
+        {
+            "account_id": account_id,
+            "cursor": index,
+            "token": "1fa4c0ad5c66e43ebd525611f3869f53",
+        }
+    )
     try:
         async with AsyncHttpClient(timeout=120) as http_client:
             response = await http_client.post(target_url, headers=headers, data=payload)