Skip to content

Commit 120c83a

Browse files
author
codervibe
committed
feat(main): 更新 API 密钥并添加查询结果 Banner
- 更新 config.yaml 文件中的 API 密钥 - 在 IPAddressQuery.py 中添加查询结果的 Banner 显示 - 更新脚本版本号至 3.1.0
1 parent 08edd15 commit 120c83a

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

main/IPAddressQuery.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import subprocess
1515
from typing import Dict, List
1616

17+
18+
1719
# ==================== 配置部分 ====================
1820
# User-Agent集合(配置项)
1921
USER_AGENTS = [
@@ -28,7 +30,7 @@
2830
]
2931

3032
# 定义脚本版本号(配置项)
31-
version = "3.0.0"
33+
version = "3.1.0"
3234

3335
# 设置日志格式
3436
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
@@ -143,6 +145,11 @@ def display_merged_result(data: dict, lang: str = "en"):
143145
ip_lat = location.get('latitude') or data.get('lat')
144146
ip_lon = location.get('longitude') or data.get('lon')
145147

148+
# 添加 Banner
149+
print("=" * 65)
150+
print("🌐IP地址位置查询结果".center(48))
151+
print("=" * 65)
152+
146153
print("\n🌍 IP 地理位置信息")
147154
print(f"IP地址: {data.get('ip', 'Unknown')}")
148155
print(f"国家名称: {location.get('country', '未知')} / {data.get('country', '未知')}")

main/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# 注意:此文件包含敏感信息,请勿提交到公开仓库或共享给非授权人员
22
# 推荐使用环境变量替代明文密钥
3-
api_key: **************
3+
api_key: *******************

0 commit comments

Comments
 (0)