Skip to content

Commit

Permalink
♻️ 重构(main.py):优化获取最新版本的代码逻辑
Browse files Browse the repository at this point in the history
🔧 修改(main.py):更新检查更新的 PyPI URL地址
  • Loading branch information
Sitoi committed Jan 15, 2024
1 parent aaeb914 commit a6e3efa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dailycheckin/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ def checkin():
print(f"第 {index + 1} 个账号: ❌❌❌❌❌\n{e}")
print("\n\n")
try:
url = "https://pypi.python.org/pypi/dailycheckin/json"
data = list(requests.get(url=url, timeout=30).json()["releases"].keys())
data.sort()
latest_version = data[-1]
url = "https://pypi.org/pypi/dailycheckin/json"
latest_version = requests.get(url=url, timeout=30).json()["info"]["version"]
except:
print("获取最新版本失败")
latest_version = "0.0.0"
Expand Down

0 comments on commit a6e3efa

Please sign in to comment.