feat(NFLmusic): 添加自定义音质功能并修复部分接口问题
- 在 QQ 和 XIAOFEN 接口中添加 br 参数以支持自定义音质 - 在 KUGOU 接口中添加 quality 参数以支持自定义音质- 修复 QQ 接口返回的歌曲信息字段名称 -修复 KUGOU 接口返回的歌手信息字段名称 -优化用户配置加载逻辑,确保在音质选择中使用正确的值- 更新软件版本号至 4.2.1
This commit is contained in:
20
NFLmusic.py
20
NFLmusic.py
@ -177,18 +177,18 @@ def download_music(song_name, choose):
|
||||
singer = resp.json()["singer"]
|
||||
music_url = resp.json()["music_url"]
|
||||
elif choice == "QQ":
|
||||
resp = requests.get(f"{url}?msg={song_name}&n={choose}&num=60&type=json")
|
||||
resp = requests.get(f"{url}?msg={song_name}&n={choose}&num=60&type=json&br={br}")
|
||||
resp.close()
|
||||
try:
|
||||
lrc = resp.json()["data"]["lyric"]
|
||||
except Exception as e:
|
||||
print(f"download_qq_lrc: {e}")
|
||||
lrc = ""
|
||||
music_name = resp.json()["data"]["title"]
|
||||
singer = resp.json()["data"]["singer"]
|
||||
music_name = resp.json()["data"]["song_name"]
|
||||
singer = resp.json()["data"]["song_singer"]
|
||||
music_url = resp.json()["data"]["music_url"]
|
||||
elif choice == "KUGOU":
|
||||
resp = requests.get(f"{url}?gm={song_name}&n={choose}&num=60&type=json")
|
||||
resp = requests.get(f"{url}?gm={song_name}&n={choose}&num=60&type=json&quality={br}")
|
||||
resp.close()
|
||||
try:
|
||||
lrc = resp.json()["lyrics"]
|
||||
@ -210,7 +210,7 @@ def download_music(song_name, choose):
|
||||
singer = resp.json()["data"]["singer"]
|
||||
music_url = resp.json()["data"]["url"]
|
||||
elif choice == "XIAOFEN":
|
||||
resp = requests.get(f"{url}?msg={song_name}&n={choose}&num=60&type=json")
|
||||
resp = requests.get(f"{url}?msg={song_name}&n={choose}&num=60&type=json&br={br}")
|
||||
resp.close()
|
||||
try:
|
||||
lrc = resp.json()["lrc"]
|
||||
@ -350,8 +350,8 @@ def get_data_without_blocking(song_name):
|
||||
artist = jsondata[index]["singer"]
|
||||
album = jsondata[index]["songid"]
|
||||
elif choice == "QQ":
|
||||
full_name = jsondata[index]["title"]
|
||||
artist = jsondata[index]["singer"]
|
||||
full_name = jsondata[index]["song_title"]
|
||||
artist = jsondata[index]["song_singer"]
|
||||
album = ""
|
||||
elif choice == "KUGOU":
|
||||
full_name = jsondata[index]["title"]
|
||||
@ -1310,7 +1310,7 @@ def search_local_song():
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
version = "4.2.0"
|
||||
version = "4.2.1"
|
||||
poem = ""
|
||||
appdata = os.getenv("APPDATA")
|
||||
make_resource()
|
||||
@ -1329,6 +1329,8 @@ try:
|
||||
br_list = [br for br in br_dict]
|
||||
path = jsondata["path"]
|
||||
br = jsondata["br"][choice]
|
||||
if br not in br_list:
|
||||
br = ij.usercache["br"][choice]
|
||||
auto_update = jsondata["auto_update"]
|
||||
playingmode = jsondata["playing_mode"]
|
||||
auto_play = jsondata["auto_play"]
|
||||
@ -1344,6 +1346,8 @@ except:
|
||||
br_list = [br for br in br_dict]
|
||||
path = jsondata["path"]
|
||||
br = jsondata["br"][choice]
|
||||
if br not in br_list:
|
||||
br = ij.usercache["br"][choice]
|
||||
auto_update = jsondata["auto_update"]
|
||||
playingmode = jsondata["playing_mode"]
|
||||
auto_play = jsondata["auto_play"]
|
||||
|
Reference in New Issue
Block a user