From 08da529d84b89f983649df776844649d98befbe4 Mon Sep 17 00:00:00 2001 From: NFL_jiancx <1678594309@qq.com> Date: Fri, 3 Oct 2025 16:16:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(NFLmusic):=20=E6=B7=BB=E5=8A=A0=E8=81=9A?= =?UTF-8?q?=E5=90=88=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=E6=94=AF=E6=8C=81?= =?UTF-8?q?-=20=E6=96=B0=E5=A2=9E=20JUHE=20=E6=90=9C=E7=B4=A2=E9=80=89?= =?UTF-8?q?=E9=A1=B9=EF=BC=8C=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87=E8=81=9A?= =?UTF-8?q?=E5=90=88=E6=8E=A5=E5=8F=A3=E8=8E=B7=E5=8F=96=E9=9F=B3=E4=B9=90?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=20-=20=E8=B0=83=E6=95=B4=E6=AD=8C=E8=AF=8D?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E9=80=BB=E8=BE=91=E4=BB=A5=E9=80=82=E9=85=8D?= =?UTF-8?q?=E6=96=B0=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=84?= =?UTF-8?q?=20-=20=E4=BF=AE=E6=94=B9=E6=AD=8C=E6=9B=B2=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=80=BB=E8=BE=91=EF=BC=8C=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E4=B8=8D=E5=90=8C=E5=B9=B3=E5=8F=B0=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=20-=20=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E8=87=B34.3.3=20-=20=E5=9C=A8=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E4=B8=AD=E5=A2=9E=E5=8A=A0=E2=80=9C=E8=81=9A?= =?UTF-8?q?=E5=90=88=E6=90=9C=E7=B4=A2=E2=80=9D=E5=85=A5=E5=8F=A3=E5=B9=B6?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E4=B8=BA=20JUHE=20=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NFLmusic.py | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/NFLmusic.py b/NFLmusic.py index a424f13..da60205 100644 --- a/NFLmusic.py +++ b/NFLmusic.py @@ -198,6 +198,18 @@ def download_music(song_name, choose): music_name = resp.json()["title"] singer = resp.json()["singer"] music_url = resp.json()["music_url"] + elif choice == "JUHE": + song_name = song_name.replace(" ", "") + resp = requests.get(f"{url}?msg={song_name}&n={choose}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3") + resp.close() + try: + lrc = resp.json()["data"]["lyric"] + except Exception as e: + print(f"download_kg_lrc: {e}") + lrc = "" + music_name = resp.json()["data"]["title"] + singer = resp.json()["data"]["singer"] + music_url = resp.json()["data"]["url"] else: lrc = "" lrc = lrc.replace("\\n", "\n") @@ -312,27 +324,33 @@ def get_data_without_blocking(song_name): url1 = f"{url}?msg={song_name}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3" elif choice == "KUGOU": url1 = f"{url}?msg={song_name.replace(' ', '')}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3" + elif choice == "JUHE": + url1 = f"{url}?msg={song_name.replace(' ', '')}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3" resp = requests.get(url1) - jsondata = resp.json()["data"] + jsondata = resp.json() resp.close() last_search_target = song_name - for index in range(len(jsondata)): + for index in range(len(jsondata["data"])): if choice == "KUWO": - full_name = jsondata[index]["songname"] - artist = jsondata[index]["singer"] - album = jsondata[index]["song_rid"] + full_name = jsondata["data"][index]["songname"] + artist = jsondata["data"][index]["singer"] + album = jsondata["data"][index]["song_rid"] elif choice == "WANGYIYUN": - full_name = jsondata[index]["title"] - artist = jsondata[index]["singer"] - album = jsondata[index]["songid"] + full_name = jsondata["data"][index]["title"] + artist = jsondata["data"][index]["singer"] + album = jsondata["data"][index]["songid"] elif choice == "QQ": - full_name = jsondata[index]["song_title"] - artist = jsondata[index]["song_singer"] + full_name = jsondata["data"][index]["song_title"] + artist = jsondata["data"][index]["song_singer"] album = "" elif choice == "KUGOU": + full_name = jsondata["data"][index]["title"] + artist = jsondata["data"][index]["singer"] + album = "" + elif choice == "JUHE": full_name = jsondata[index]["title"] artist = jsondata[index]["singer"] - album = "" + album = jsondata[index]["app"] songlist.insert("", "end", values=(full_name, artist, album)) except requests.exceptions.JSONDecodeError: resp_text = resp.text @@ -1296,7 +1314,7 @@ def search_local_song(): time.sleep(1) -version = "4.3.2" +version = "4.3.3" poem = "" appdata = os.getenv("APPDATA") make_resource() @@ -1661,6 +1679,7 @@ repo_dict = { "QQ音乐": "QQ", "网易云音乐": "WANGYIYUN", "酷狗音乐": "KUGOU", + "聚合搜索": "JUHE" } repo_dict_reverse = {} for repo in repo_dict: