增加版本管理
This commit is contained in:
30
NFLmusic.py
30
NFLmusic.py
@ -143,26 +143,34 @@ def download_music(song_name, choose):
|
|||||||
br = br_dict[var.get()]
|
br = br_dict[var.get()]
|
||||||
if choice == "KUWO":
|
if choice == "KUWO":
|
||||||
resp = requests.get(f"{url}/?msg={song_name}&n={choose}&br={br}&limit=60")
|
resp = requests.get(f"{url}/?msg={song_name}&n={choose}&br={br}&limit=60")
|
||||||
else:
|
resp.close()
|
||||||
resp = requests.get(f"{url}/?name={song_name}&n={choose}&br={br}&limit=60")
|
id = resp.json()["data"]["rid"].replace("MUSIC_", "")
|
||||||
resp.close()
|
resp_lrc = requests.get(f"https://api.jkyai.top/API/yyjhss.php?id={id}&type=kw")
|
||||||
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_lrc.close()
|
resp_lrc.close()
|
||||||
try:
|
try:
|
||||||
lrc = resp_lrc.json()["data"]["content"]
|
lrc = resp_lrc.json()["data"]["lrc"]
|
||||||
except:
|
except Exception as e:
|
||||||
|
print(f"download_kw_lrc: {e}")
|
||||||
lrc = ""
|
lrc = ""
|
||||||
else:
|
|
||||||
lrc = ""
|
|
||||||
if choice == "KUWO":
|
|
||||||
music_name = resp.json()["data"]["song"]
|
music_name = resp.json()["data"]["song"]
|
||||||
singer = resp.json()["data"]["singer"]
|
singer = resp.json()["data"]["singer"]
|
||||||
music_url = resp.json()["data"]["url"]
|
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"]
|
music_name = resp.json()["data"]["name"]
|
||||||
singer = resp.json()["data"]["singers"][0]["name"]
|
singer = resp.json()["data"]["singers"][0]["name"]
|
||||||
music_url = resp.json()["data"]["url"]
|
music_url = resp.json()["data"]["url"]
|
||||||
|
else:
|
||||||
|
lrc = ""
|
||||||
response = requests.get(music_url, stream=True)
|
response = requests.get(music_url, stream=True)
|
||||||
formated = music_url.split("?")[0].rsplit(".", 1)[1]
|
formated = music_url.split("?")[0].rsplit(".", 1)[1]
|
||||||
filename_without_endswith = f"{singer} - {music_name}"
|
filename_without_endswith = f"{singer} - {music_name}"
|
||||||
|
@ -1 +1 @@
|
|||||||
"".rsplit()
|
print("_wenren".split("_"))
|
Reference in New Issue
Block a user