From 2f55ba294f55b9e7e389c1fca1af20f42f9739a2 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Sat, 2 May 2026 18:56:48 +0800 Subject: [PATCH] auto-sync: 2026-05-02 18:56:48 --- data_platform/updater.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data_platform/updater.py b/data_platform/updater.py index e41fb4de..65c239d3 100644 --- a/data_platform/updater.py +++ b/data_platform/updater.py @@ -86,7 +86,8 @@ def fetch_incremental(code: str, start_date: str, end_date: str): days = (pd.Timestamp(end_date) - pd.Timestamp(start_date)).days + 10 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: + 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()) klines = data.get("data", {}).get(tq, {}).get("day", []) if not klines: