更新NFLmusicv4.0.0版本

This commit is contained in:
2025-01-23 18:17:51 +08:00
parent 9b3f1d1654
commit 6af9abc03e
9 changed files with 53 additions and 423 deletions

View File

@ -27,10 +27,6 @@ from nflmusic.load_gif import *
def opening_animation():
global loaded, appdata
def jump_to_url(url):
webbrowser.open(url)
while True:
try:
root0 = Frame(root, height=530, width=810)
@ -130,7 +126,10 @@ def download_music(song_name, choose):
style='success.Striped.Horizontal.TProgressbar')
progressbar.place(x=10, y=300)
br = br_dict[var.get()]
resp = requests.get(f"{url}/?name={song_name}&n={choose}&br={br}&max=60&pagesize=60")
if choice == "KUWO":
resp = requests.get(f"{url}/?msg={song_name}&n={choose}&br={br}&max=60&pagesize=60")
else:
resp = requests.get(f"{url}/?name={song_name}&n={choose}&br={br}&max=60&pagesize=60")
resp.close()
if url == "https://api.xingzhige.com/API/Kugou_GN_new":
resp_lrc = requests.get(f"https://oiapi.net/API/Kggc/?msg={song_name}&n={choose}&limit=60")
@ -141,9 +140,14 @@ def download_music(song_name, choose):
lrc = ""
else:
lrc = ""
music_name = resp.json()["data"]["songname"]
singer = resp.json()["data"]["name"]
music_url = resp.json()["data"]["src"]
if choice == "KUWO":
music_name = resp.json()["data"]["song"]
singer = resp.json()["data"]["singer"]
music_url = resp.json()["data"]["url"]
else:
music_name = resp.json()["data"]["name"]
singer = resp.json()["data"]["singers"][0]["name"]
music_url = resp.json()["data"]["url"]
response = requests.get(music_url, stream=True)
formated = music_url.split("?")[0].rsplit(".", 1)[1]
filename_without_endswith = f"{singer} - {music_name}"
@ -242,15 +246,23 @@ def get_data_without_blocking(song_name):
try:
button0["state"] = "disabled"
songlist.delete(*songlist.get_children())
url1 = f"{url}/?name={song_name}&max=60&pagesize=60"
if choice == "KUWO":
url1 = f"{url}/?msg={song_name}&max=60&pagesize=60"
else:
url1 = f"{url}/?name={song_name}&max=60&pagesize=60"
resp = requests.get(url1)
jsondata = resp.json()["data"]
resp.close()
last_search_target = song_name
for index in range(len(jsondata)):
full_name = jsondata[index]["songname"]
artist = jsondata[index]["name"]
album = jsondata[index]["album"]
if choice == "KUWO":
full_name = jsondata[index]["song"]
artist = jsondata[index]["singer"]
album = jsondata[index]["album"]
else:
full_name = jsondata[index]["name"]
artist = jsondata[index]["singers"][0]["name"]
album = ""
songlist.insert("", "end", values=(full_name, artist, album))
except requests.exceptions.JSONDecodeError:
resp_text = resp.text
@ -1098,7 +1110,7 @@ def download_version():
copy(version_json[get_treeview_index(version_list, version_download_choice)]["password"])
version = "3.9.3"
version = "4.0.0"
poem = ""
appdata = os.getenv("APPDATA")
make_resource()
@ -1352,7 +1364,7 @@ labelframe_thanks.place(x=540, y=20)
# 鸣谢
xingzhige = "https://api.xingzhige.com/"
gitee = "https://gitee.com/"
yunyikeji = "https://pan.yunyikeji.icu/"
nanfect = "http://pan.nanfengling.cn/"
skylark = "https://space.bilibili.com/1868716664"
sponsorship = "https://afdian.net/a/NFLstudio"
@ -1363,7 +1375,7 @@ lb1 = lb(pack_box=labelframe_thanks, label=lang.get(la, 'ui.thanks.text.random_p
button=lang.get(la, 'ui.thanks.button.random_poem'), command=lambda: webbrowser.open(gitee))
lb1.place(button=(80, 60), 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(yunyikeji))
button=lang.get(la, 'ui.thanks.button.file_store'), command=lambda: webbrowser.open(nanfect))
lb2.place(button=(80, 100), label=(10, 100))
lb3 = lb(pack_box=labelframe_thanks, label=lang.get(la, 'ui.thanks.text.bug_fix'),
button=lang.get(la, 'ui.thanks.button.bug_fix'), command=lambda: webbrowser.open(skylark))
@ -1443,9 +1455,7 @@ themeLabel.place(x=10, y=20)
# 基本设置
repo_dict = {
"QQ音乐": "QQ",
"酷我音乐": "KUWO",
"酷狗音乐": "KUGOU",
"网易云音乐": "WANGYIYUN"
}
repo_dict_reverse = {}
@ -1457,6 +1467,10 @@ language_list = lang.list_languages()
label3 = Label(labelframe_settings, text=lang.get(la, 'ui.settings.text.download_source', ))
label3.place(x=10, y=60)
if not repo_dict_reverse.get("choice"):
jsondata["choice"] = "KUWO"
menu0 = OptionMenu(labelframe_settings, var4, repo_dict_reverse[jsondata["choice"]],
*repo_list)
menu0.place(x=80, y=60)