auto-sync: 2026-05-02 18:58:14

This commit is contained in:
cfdaily
2026-05-02 18:58:14 +08:00
parent cb098026eb
commit 1b71af42d7
+4 -2
View File
@@ -76,9 +76,11 @@ class FallbackManager:
days = (datetime.strptime(end_date, "%Y-%m-%d") - datetime.strptime(start_date, "%Y-%m-%d")).days + 10
url = f"https://web.ifzq.gtimg.cn/appstock/app/fqkline/get?param={tq_symbol},day,,{days},"
try:
import urllib.request, json as _json
opener = urllib.request.build_opener(urllib.request.ProxyHandler({}))
req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
with urllib.request.urlopen(req, timeout=10) as r:
data = json.loads(r.read())
with opener.open(req, timeout=10) as r:
data = _json.loads(r.read())
klines = data.get("data", {}).get(tq_symbol, {}).get("day", [])
if not klines:
return None