diff --git a/backend/services/eastmoney.py b/backend/services/eastmoney.py index 4cc623d..6271215 100644 --- a/backend/services/eastmoney.py +++ b/backend/services/eastmoney.py @@ -1035,7 +1035,6 @@ async def fetch_kline_history(code: str, days: int = 90) -> Optional[list[dict]] "turnoverRate": _f(10), }) - parsed.reverse() return parsed except Exception as e: if attempt == 0: @@ -1064,10 +1063,12 @@ async def fetch_fund_flow_daykline(code: str, days: int) -> Optional[list[dict]] "Referer": "https://quote.eastmoney.com/", } + from curl_cffi.requests import AsyncSession + for attempt in range(2): - async with httpx.AsyncClient() as client: + async with AsyncSession(impersonate="chrome120") as session: try: - resp = await client.get(url, headers=headers, timeout=10) + resp = await session.get(url, headers=headers, timeout=10) if resp.status_code != 200: if attempt == 0: continue