|
@@ -10,7 +10,7 @@ from applications.api import log
|
|
|
from applications.utils import request_retry
|
|
from applications.utils import request_retry
|
|
|
from applications.utils import AsyncHttpClient
|
|
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
|
|
# url from aigc
|
|
|
base_url = "http://crawler-cn.aiddit.com/crawler/wei_xin"
|
|
base_url = "http://crawler-cn.aiddit.com/crawler/wei_xin"
|
|
@@ -51,7 +51,13 @@ async def get_article_detail(
|
|
|
@retry(**retry_desc)
|
|
@retry(**retry_desc)
|
|
|
async def get_article_list_from_account(account_id: str, index=None) -> dict | None:
|
|
async def get_article_list_from_account(account_id: str, index=None) -> dict | None:
|
|
|
target_url = f"{base_url}/blogger"
|
|
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:
|
|
try:
|
|
|
async with AsyncHttpClient(timeout=120) as http_client:
|
|
async with AsyncHttpClient(timeout=120) as http_client:
|
|
|
response = await http_client.post(target_url, headers=headers, data=payload)
|
|
response = await http_client.post(target_url, headers=headers, data=payload)
|