feat: all remaining Tencent API price fetchers now DB-first (8 files)
This commit is contained in:
@@ -54,6 +54,13 @@ def get_quote(code: str) -> dict:
|
||||
prefix = "sz"
|
||||
fields = F
|
||||
|
||||
# DB 优先
|
||||
try:
|
||||
from mofin_db import get_price_from_db
|
||||
p, chg = get_price_from_db(raw)
|
||||
if p: return {"price": p, "name": name, "code": raw, "change_pct": chg or 0}
|
||||
except: pass
|
||||
# Fallback: 腾讯
|
||||
url = f"http://qt.gtimg.cn/q={prefix}{raw}"
|
||||
try:
|
||||
req = urllib.request.Request(url, headers={
|
||||
|
||||
Reference in New Issue
Block a user