增加版本管理

This commit is contained in:
2025-02-11 20:32:45 +08:00
parent 2fff5db81e
commit 919f1d5e87
3 changed files with 20 additions and 12 deletions

View File

@ -143,26 +143,34 @@ def download_music(song_name, choose):
br = br_dict[var.get()]
if choice == "KUWO":
resp = requests.get(f"{url}/?msg={song_name}&n={choose}&br={br}&limit=60")
else:
resp = requests.get(f"{url}/?name={song_name}&n={choose}&br={br}&limit=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")
resp.close()
id = resp.json()["data"]["rid"].replace("MUSIC_", "")
resp_lrc = requests.get(f"https://api.jkyai.top/API/yyjhss.php?id={id}&type=kw")
resp_lrc.close()
try:
lrc = resp_lrc.json()["data"]["content"]
except:
lrc = resp_lrc.json()["data"]["lrc"]
except Exception as e:
print(f"download_kw_lrc: {e}")
lrc = ""
else:
lrc = ""
if choice == "KUWO":
music_name = resp.json()["data"]["song"]
singer = resp.json()["data"]["singer"]
music_url = resp.json()["data"]["url"]
else:
elif choice == "WANGYIYUN":
resp = requests.get(f"{url}/?name={song_name}&n={choose}&br={br}&limit=60")
resp.close()
id = resp.json()["data"]["id"]
resp_lrc = requests.get(f"https://api.jkyai.top/API/yyjhss.php?id={id}&type=wy")
resp_lrc.close()
try:
lrc = resp_lrc.json()["data"]["lrc"]
except Exception as e:
print(f"download_wyy_lrc: {e}")
lrc = ""
music_name = resp.json()["data"]["name"]
singer = resp.json()["data"]["singers"][0]["name"]
music_url = resp.json()["data"]["url"]
else:
lrc = ""
response = requests.get(music_url, stream=True)
formated = music_url.split("?")[0].rsplit(".", 1)[1]
filename_without_endswith = f"{singer} - {music_name}"