From d6f030581bb7b9de50e231ba4618c5f57bf5b21a Mon Sep 17 00:00:00 2001 From: NFL_jiancx <1678594309@qq.com> Date: Wed, 30 Apr 2025 22:38:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(KUWO):=20=E4=BF=AE=E5=A4=8D=E9=85=B7?= =?UTF-8?q?=E6=88=91=E9=9F=B3=E4=B9=90=E4=B8=8B=E8=BD=BD=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E5=92=8C=E4=BF=A1=E6=81=AF=E8=8E=B7=E5=8F=96-=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BA=86=E9=85=B7=E6=88=91=E9=9F=B3=E4=B9=90=20API=20?= =?UTF-8?q?=E7=9A=84=E8=AF=B7=E6=B1=82=20URL=20=E5=92=8C=E5=8F=82=E6=95=B0?= =?UTF-8?q?=20-=20=E4=BF=AE=E6=94=B9=E4=BA=86=E4=BB=8E=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E4=B8=AD=E8=8E=B7=E5=8F=96=E6=AD=8C=E6=9B=B2=20ID=E3=80=81?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E3=80=81=E6=AD=8C=E6=89=8B=E5=92=8C=20URL=20?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E6=B3=95=20-=20=E4=BC=98=E5=8C=96=E4=BA=86?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E7=9A=84=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91=20-=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=AF=B9?= =?UTF-8?q?=E9=85=B7=E6=88=91=E9=9F=B3=E4=B9=90=20flac=20=E9=9F=B3?= =?UTF-8?q?=E8=B4=A8=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NFLmusic.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/NFLmusic.py b/NFLmusic.py index f26cd66..c89939f 100644 --- a/NFLmusic.py +++ b/NFLmusic.py @@ -143,9 +143,9 @@ def download_music(song_name, choose): progressbar.place(x=10, y=300) br = br_dict[var.get()] 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}&num=60&type=json") resp.close() - id = resp.json()["data"]["rid"].replace("MUSIC_", "") + id = resp.json()["link"].rsplit("/", 1)[1] try: resp_lrc = requests.get(f"http://m.kuwo.cn/newh5/singles/songinfoandlrc?musicId={id}") resp_lrc.close() @@ -159,9 +159,9 @@ def download_music(song_name, choose): except Exception as e: print(f"download_kw_lrc: {e}") lrc = "" - music_name = resp.json()["data"]["song"] - singer = resp.json()["data"]["singer"] - music_url = resp.json()["data"]["url"] + music_name = resp.json()["song_name"] + singer = resp.json()["song_singer"] + music_url = resp.json()["flac_url"] elif choice == "WANGYIYUN": resp = requests.get(f"{url}/?name={song_name}&n={choose}&br={br}&limit=60") resp.close() @@ -277,7 +277,7 @@ def get_data_without_blocking(song_name): button0["state"] = "disabled" songlist.delete(*songlist.get_children()) if choice == "KUWO": - url1 = f"{url}/?msg={song_name}&limit=60" + url1 = f"{url}?msg={song_name}&num=60&type=json" else: url1 = f"{url}/?name={song_name}&limit=60" resp = requests.get(url1) @@ -286,10 +286,10 @@ def get_data_without_blocking(song_name): last_search_target = song_name for index in range(len(jsondata)): if choice == "KUWO": - full_name = jsondata[index]["song"] + full_name = jsondata[index]["songname"] artist = jsondata[index]["singer"] - album = jsondata[index]["album"] - else: + album = jsondata[index]["song_rid"] + elif choice == "WANGYIYUN": full_name = jsondata[index]["name"] artist = jsondata[index]["singers"][0]["name"] album = "" @@ -1238,7 +1238,7 @@ def search_local_song(): time.sleep(1) -version = "4.1.10" +version = "4.1.11" poem = "" appdata = os.getenv("APPDATA") make_resource()