fix: restore 0.1s sleep between Eastmoney HK requests (anti-scraping)

This commit is contained in:
知微
2026-07-01 23:21:40 +08:00
parent 0faa58d211
commit 6918dffd10
+1
View File
@@ -155,6 +155,7 @@ def fetch_hk_eastmoney(codes):
change_pct = str(item.get("f170", "0")) change_pct = str(item.get("f170", "0"))
if price > 0: if price > 0:
results[code] = (price, change, change_pct) results[code] = (price, change, change_pct)
time.sleep(0.1) # 防止触发东财反爬(逐股查询,不支持批量)
except Exception as e: except Exception as e:
print(f"⚠️ 东方财富 {code} 拉取失败: {e}", file=sys.stderr) print(f"⚠️ 东方财富 {code} 拉取失败: {e}", file=sys.stderr)
continue continue