Skip to content

Commit 39b453d

Browse files
committed
fix: switch Sina and Tencent endpoints to HTTPS
1 parent f9549c7 commit 39b453d

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

data_provider/akshare_fetcher.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -931,17 +931,17 @@ def _get_stock_realtime_quote_sina(self, stock_code: str) -> Optional[UnifiedRea
931931
优点:单股票查询,负载小,速度快
932932
缺点:数据字段较少,无量比/PE/PB等
933933
934-
接口格式:http://hq.sinajs.cn/list=sh600519,sz000001
934+
接口格式:https://hq.sinajs.cn/list=sh600519,sz000001
935935
"""
936936
circuit_breaker = get_realtime_circuit_breaker()
937937
source_key = "akshare_sina"
938938
symbol = _to_sina_tx_symbol(stock_code)
939-
url = f"http://{SINA_REALTIME_ENDPOINT}={symbol}"
939+
url = f"https://{SINA_REALTIME_ENDPOINT}={symbol}"
940940
api_start = time.time()
941941

942942
try:
943943
headers = {
944-
'Referer': 'http://finance.sina.com.cn',
944+
'Referer': 'https://finance.sina.com.cn',
945945
'User-Agent': random.choice(USER_AGENTS)
946946
}
947947

@@ -1082,17 +1082,17 @@ def _get_stock_realtime_quote_tencent(self, stock_code: str) -> Optional[Unified
10821082
优点:单股票查询,负载小,包含换手率
10831083
缺点:无量比/PE/PB等估值数据
10841084
1085-
接口格式:http://qt.gtimg.cn/q=sh600519,sz000001
1085+
接口格式:https://qt.gtimg.cn/q=sh600519,sz000001
10861086
"""
10871087
circuit_breaker = get_realtime_circuit_breaker()
10881088
source_key = "akshare_tencent"
10891089
symbol = _to_sina_tx_symbol(stock_code)
1090-
url = f"http://{TENCENT_REALTIME_ENDPOINT}={symbol}"
1090+
url = f"https://{TENCENT_REALTIME_ENDPOINT}={symbol}"
10911091
api_start = time.time()
10921092

10931093
try:
10941094
headers = {
1095-
'Referer': 'http://finance.qq.com',
1095+
'Referer': 'https://finance.qq.com',
10961096
'User-Agent': random.choice(USER_AGENTS)
10971097
}
10981098

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
1111

1212
<!-- 新条目格式:- [类型] 描述(类型取值:新功能/改进/修复/文档/测试/chore)-->
1313
<!-- 每条独立一行追加到本段末尾,无需分类标题,合并时冲突最小 -->
14+
- [修复] 将新浪 (Sina) 和腾讯 (Tencent) 实时行情接口切换至 HTTPS,提升数据传输安全性。
1415
- [改进] 放宽 LiteLLM 依赖约束,保留 `>=1.80.10` 最低版本并显式排除 PyPI 事故版本 `1.82.7` / `1.82.8`,允许安装后续 1.x 修复版本。
1516
- [改进] 补齐通知渠道 P0 基线、Actions 映射与 `--check-notify` 只读诊断,完善 AstrBot 配置入口和通知回归快照。
1617
- [chore] 清理仓库根目录:移除误入库的 `.codex``review.md` 跟踪记录,将 smoke 测试入口迁移到 `scripts/`、环境检查脚本迁移为 `scripts/check_env.py`,并将 LiteLLM YAML 示例迁移到 `docs/examples/`

0 commit comments

Comments
 (0)