From 415ba0b6e6bd56e00ffd37b8f5af0200ba3fc3ba Mon Sep 17 00:00:00 2001 From: cfdaily Date: Sat, 2 May 2026 18:54:48 +0800 Subject: [PATCH] auto-sync: 2026-05-02 18:54:48 --- data_platform/updater.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/data_platform/updater.py b/data_platform/updater.py index 3804371b..e41fb4de 100644 --- a/data_platform/updater.py +++ b/data_platform/updater.py @@ -84,12 +84,10 @@ def fetch_incremental(code: str, start_date: str, end_date: str): prefix = 'sh' if code.startswith(('6', '5', '1')) else 'sz' tq = f"{prefix}{code}" days = (pd.Timestamp(end_date) - pd.Timestamp(start_date)).days + 10 - url = f"https://web.ifzq.gtimg.cn/appstock/app/fqkline/get?_var=kline_dayqfq¶m={tq},day,,{days},qfqa" + url = f"https://web.ifzq.gtimg.cn/appstock/app/fqkline/get?param={tq},day,,{days}," import urllib.request, json with urllib.request.urlopen(url, timeout=10) as r: - raw = r.read().decode('gbk') - json_str = raw.split('=', 1)[1] - data = json.loads(json_str) + data = json.loads(r.read()) klines = data.get("data", {}).get(tq, {}).get("day", []) if not klines: return None