From 0c07ecb83210f2065dc031b6ce223b4caae508e7 Mon Sep 17 00:00:00 2001 From: NFL_jiancx <1678594309@qq.com> Date: Thu, 1 May 2025 12:22:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(NFLmusic):=20=E6=B7=BB=E5=8A=A0=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=9F=B3=E8=B4=A8=E5=8A=9F=E8=83=BD=E5=B9=B6?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E6=8E=A5=E5=8F=A3=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 QQ 和 XIAOFEN 接口中添加 br 参数以支持自定义音质 - 在 KUGOU 接口中添加 quality 参数以支持自定义音质- 修复 QQ 接口返回的歌曲信息字段名称 -修复 KUGOU 接口返回的歌手信息字段名称 -优化用户配置加载逻辑,确保在音质选择中使用正确的值- 更新软件版本号至 4.2.1 --- NFLmusic.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/NFLmusic.py b/NFLmusic.py index a1a551d..5c792e9 100644 --- a/NFLmusic.py +++ b/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"]