refactor: 更新代码中的 API地址和项目链接

-将 Gitee 地址替换为 Nanfengling Git 地址
- 更新随机诗句、公告、版本信息等 API 地址
- 修改赞助商列表和鸣谢部分的链接
- 优化代码结构,提高可读性和可维护性
This commit is contained in:
2025-02-11 20:44:17 +08:00
parent fcd600f1cd
commit 697954a8c2

View File

@ -416,10 +416,10 @@ def display_sentences():
time.sleep(0.1)
poem = ""
try:
resp = requests.get("https://gitee.com/nfl-tangh/nflmusic/raw/master/random_quote")
resp = requests.get("http://git.nanfengling.cn/NFL_jiancx/NFLmusic/raw/branch/master/version_info/random_quote")
poem = resp.text.replace("\r", "").split("\n")
resp.close()
resp0 = requests.get("https://gitee.com/nfl-tangh/nflmusic/raw/master/announcement")
resp0 = requests.get("http://git.nanfengling.cn/NFL_jiancx/NFLmusic/raw/branch/master/version_info/announcement")
announcement_text = resp0.text.replace("\n", "")
resp0.close()
poem = c(poem)
@ -606,12 +606,12 @@ def update():
if not os.path.exists(appdata + "/.NFLmusic/update"):
os.mkdir(appdata + "/.NFLmusic/update")
if not have_checked:
data_url = "https://gitee.com/nfl-tangh/nflmusic/raw/master/data"
data_url = "http://git.nanfengling.cn/NFL_jiancx/NFLmusic/raw/branch/master/version_info/data"
data_resp = requests.get(data_url)
data_resp.close()
datalist = data_resp.text.replace("\r", "").split("\n")
update_path = appdata + "/.NFLmusic/update/"
data_url = "https://gitee.com/nfl-tangh/nflmusic/raw/master/latest_update_log"
data_url = "http://git.nanfengling.cn/NFL_jiancx/NFLmusic/raw/branch/master/version_info/latest_update_log"
data_resp = requests.get(data_url).text
latest_version = datalist[0]
if latest_version != version:
@ -730,7 +730,7 @@ def check_update():
global datalist, have_checked
check_update_button["state"] = "disabled"
try:
data_url = "https://gitee.com/nfl-tangh/nflmusic/raw/master/data"
data_url = "http://git.nanfengling.cn/NFL_jiancx/NFLmusic/raw/branch/master/version_info/data"
data_resp = requests.get(data_url)
datalist = data_resp.text.replace("\r", "").split("\n")
latest_version = datalist[0]
@ -1113,7 +1113,7 @@ def load_versions():
global version_json
time.sleep(0.5)
try:
resp = requests.get("https://gitee.com/nfl-tangh/nflmusic/raw/master/version_list.json")
resp = requests.get("http://git.nanfengling.cn/NFL_jiancx/NFLmusic/raw/branch/master/version_info/version_list.json")
version_json = resp.json()
resp.close()
for version_item in version_json:
@ -1418,7 +1418,7 @@ labelframe_thanks.place(x=540, y=20)
# 鸣谢
oiapi = "https://oiapi.net/"
gitee = "https://gitee.com/"
githook = "http://git.nanfengling.cn/"
nanfect = "http://pan.nanfengling.cn/"
skylark = "https://space.bilibili.com/1868716664"
sponsorship = "https://afdian.com/a/NFLstudio"
@ -1427,7 +1427,7 @@ lb0 = lb(pack_box=labelframe_thanks, label=lang.get(la, 'ui.thanks.text.music_ur
button=lang.get(la, 'ui.thanks.button.music_url'), command=lambda: webbrowser.open(oiapi))
lb0.place(button=(80, 15), label=(10, 20))
lb1 = lb(pack_box=labelframe_thanks, label=lang.get(la, 'ui.thanks.text.random_poem'),
button=lang.get(la, 'ui.thanks.button.random_poem'), command=lambda: webbrowser.open(gitee))
button=lang.get(la, 'ui.thanks.button.random_poem'), command=lambda: webbrowser.open(githook))
lb1.place(button=(80, 55), label=(10, 60))
lb2 = lb(pack_box=labelframe_thanks, label=lang.get(la, 'ui.thanks.text.file_store'),
button=lang.get(la, 'ui.thanks.button.file_store'), command=lambda: webbrowser.open(nanfect))
@ -1445,7 +1445,7 @@ sponsors_list.place(x=10, y=210)
scrollbar3.config(command=sponsors_list.yview)
scrollbar3.place(x=227, y=210, height=240)
try:
data_url = "https://gitee.com/nfl-tangh/nflmusic/raw/master/sponsors"
data_url = "http://git.nanfengling.cn/NFL_jiancx/NFLmusic/raw/branch/master/version_info/sponsors"
data_resp = requests.get(data_url)
data_list = data_resp.text.replace("\r", "").split("\n")
for sponsor in data_list: