修复两个问题:

1. 移除 eastmoney K线接口的 parsed.reverse(),统一为升序返回(与其他数据源一致),
   修复 K线图时间方向相反、每日行情明细展示远期数据的 bug

2. fetch_fund_flow_daykline 改用 curl_cffi 替代 httpx,匹配东方财富 push2his
   的 TLS 指纹检测,修复主力资金流向数据获取不到的 bug

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Sakurasan
2026-07-24 18:19:30 +08:00
co-authored by Claude
parent b67d07e977
commit 2a0960c251
+4 -3
View File
@@ -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