feat: all remaining Tencent API price fetchers now DB-first (8 files)

This commit is contained in:
知微
2026-07-01 22:59:17 +08:00
parent 0aef122b69
commit b2822cec15
4 changed files with 29 additions and 2 deletions
+4
View File
@@ -23,6 +23,10 @@ SCANNER_STATE = "/home/hmo/web-dashboard/data/scanner_state.json"
def get_price(code):
# DB 优先
try: from mofin_db import get_price_from_db; p, _ = get_price_from_db(code); return p if p else 0
except: pass
# Fallback: 腾讯
mkt = "sh" if code.startswith("6") or code.startswith("5") else "sz"
url = f"http://qt.gtimg.cn/q={mkt}{code}"
req = Request(url, headers={"User-Agent": "Mozilla/5.0"})