Compare commits
4 Commits
5189898b6b
...
240f380026
| Author | SHA1 | Date | |
|---|---|---|---|
| 240f380026 | |||
| 4e55f0521f | |||
| f95335e39f | |||
| 3ac2c59dcd |
126
NFLmusic.py
126
NFLmusic.py
@ -140,89 +140,33 @@ def download_music(song_name, choose):
|
||||
style='success.Striped.Horizontal.TProgressbar')
|
||||
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}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3")
|
||||
if choice == "WANGYIYUN":
|
||||
resp = requests.get(f"{url}?name={song_name}&n={choose}&br={br}&limit=60&type=json&key=oiapi-e3329f47-ccbc-2279-14b6-eabd4c7286ac")
|
||||
resp.close()
|
||||
id = resp.json()["link"].rsplit("/", 1)[1]
|
||||
songid = resp.json()["data"]["id"]
|
||||
try:
|
||||
resp_lrc = requests.get(f"http://m.kuwo.cn/newh5/singles/songinfoandlrc?musicId={id}")
|
||||
resp_lrc.close()
|
||||
lrc = ""
|
||||
lrclist = resp_lrc.json()["data"]["lrclist"]
|
||||
for i in lrclist:
|
||||
total_time = i["time"]
|
||||
min = float(total_time) // 60
|
||||
sec = float(total_time) % 60
|
||||
lrc += f'[{int(min)}:{sec}]{i["lineLyric"]}\n'
|
||||
except Exception as e:
|
||||
print(f"download_kw_lrc: {e}")
|
||||
lrc = ""
|
||||
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}?gm={song_name}&n={choose}&br={br}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3")
|
||||
resp.close()
|
||||
id = resp.json()["link"].rsplit("=", 1)[1]
|
||||
try:
|
||||
resp_lrc = requests.get(f"https://music.163.com/api/song/lyric?id={id}&lv=-1&kv=-1&tv=-1")
|
||||
resp_lrc = requests.get(f"https://music.163.com/api/song/lyric?id={songid}&lv=-1&kv=-1&tv=-1")
|
||||
resp_lrc.close()
|
||||
lrc = resp_lrc.json()["lrc"]["lyric"]
|
||||
except Exception as e:
|
||||
print(f"download_wyy_lrc: {e}")
|
||||
lrc = ""
|
||||
music_name = resp.json()["title"]
|
||||
singer = resp.json()["singer"]
|
||||
music_url = resp.json()["music_url"]
|
||||
music_name = resp.json()["data"]["name"]
|
||||
singer = resp.json()["data"]["singers"][0]["name"]
|
||||
music_url = resp.json()["data"]["url"]
|
||||
elif choice == "QQ":
|
||||
resp = requests.get(f"{url}?msg={song_name}&n={choose}&num=60&type=json&br={br}&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3")
|
||||
resp = requests.get(f"{url}?msg={song_name}&n={choose}&limit=60&type=json&br={br}&key=oiapi-e3329f47-ccbc-2279-14b6-eabd4c7286ac")
|
||||
resp.close()
|
||||
songid = resp.json()["data"]["songid"]
|
||||
resp1 = requests.get(f"https://oiapi.net/api/QQMusicLyric?id={songid}")
|
||||
try:
|
||||
lrc = resp.json()["data"]["lyric"]
|
||||
lrc = resp1.json()["message"]
|
||||
except Exception as e:
|
||||
print(f"download_qq_lrc: {e}")
|
||||
lrc = ""
|
||||
music_name = resp.json()["data"]["song_name"]
|
||||
singer = resp.json()["data"]["song_singer"]
|
||||
music_url = resp.json()["data"]["music_url"]
|
||||
elif choice == "KUGOU":
|
||||
song_name = song_name.replace(" ", "")
|
||||
resp = requests.get(f"{url}?msg={song_name}&n={choose}&num=60&type=json&br={br}&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3")
|
||||
resp.close()
|
||||
try:
|
||||
lrc = resp.json()["lyrics"]
|
||||
except Exception as e:
|
||||
print(f"download_kg_lrc: {e}")
|
||||
lrc = ""
|
||||
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"]
|
||||
print(lrc)
|
||||
# 正则表达式匹配 [mm:ss]
|
||||
def convert_timestamp(match):
|
||||
mm_ss = match.group(1)
|
||||
minutes, seconds = mm_ss.split(':')
|
||||
# 转换为浮点秒数并保留一位小数(虽然这里是整数)
|
||||
total_seconds = int(minutes) * 60 + int(seconds)
|
||||
# 格式化回 mm:ss.s 形式
|
||||
new_minutes = total_seconds // 60
|
||||
new_seconds = total_seconds % 60
|
||||
return f"[{new_minutes:02d}:{new_seconds:02d}.0]"
|
||||
|
||||
# 替换所有 [mm:ss] 为 [mm:ss.0]
|
||||
lrc = re.sub(r'\[(\d{2}:\d{2})\]', convert_timestamp, lrc)
|
||||
except Exception as e:
|
||||
print(f"download_kg_lrc: {e}")
|
||||
lrc = ""
|
||||
music_name = resp.json()["data"]["title"]
|
||||
music_name = resp.json()["data"]["song"]
|
||||
singer = resp.json()["data"]["singer"]
|
||||
music_url = resp.json()["data"]["url"]
|
||||
music_url = resp.json()["data"]["music"]
|
||||
else:
|
||||
lrc = ""
|
||||
lrc = lrc.replace("\\n", "\n")
|
||||
@ -286,7 +230,8 @@ def download_music(song_name, choose):
|
||||
{"_singer_": f"{singer}", "_music_": f"{music_name}"}))
|
||||
downloading = False
|
||||
|
||||
except KeyError:
|
||||
except KeyError as e:
|
||||
print(e, type(e))
|
||||
downloading = False
|
||||
progressbar.destroy()
|
||||
if song_name == "":
|
||||
@ -329,41 +274,23 @@ def get_data_without_blocking(song_name):
|
||||
try:
|
||||
button0["state"] = "disabled"
|
||||
songlist.delete(*songlist.get_children())
|
||||
if choice == "KUWO":
|
||||
url1 = f"{url}?msg={song_name}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3"
|
||||
elif choice == "WANGYIYUN":
|
||||
url1 = f"{url}?gm={song_name}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3"
|
||||
if choice == "WANGYIYUN":
|
||||
url1 = f"{url}?name={song_name}&limit=60&type=json&key=oiapi-e3329f47-ccbc-2279-14b6-eabd4c7286ac"
|
||||
elif choice == "QQ":
|
||||
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}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3"
|
||||
url1 = f"{url}?msg={song_name}&limit=60&type=json&key=oiapi-e3329f47-ccbc-2279-14b6-eabd4c7286ac"
|
||||
resp = requests.get(url1)
|
||||
jsondata = resp.json()
|
||||
resp.close()
|
||||
last_search_target = song_name
|
||||
for index in range(len(jsondata["data"] if isinstance(jsondata, dict) else jsondata)):
|
||||
if choice == "KUWO":
|
||||
full_name = jsondata["data"][index]["songname"]
|
||||
artist = jsondata["data"][index]["singer"]
|
||||
album = jsondata["data"][index]["song_rid"]
|
||||
elif choice == "WANGYIYUN":
|
||||
full_name = jsondata["data"][index]["title"]
|
||||
if choice == "WANGYIYUN":
|
||||
full_name = jsondata["data"][index]["name"]
|
||||
artist = jsondata["data"][index]["singers"][0]["name"]
|
||||
album = jsondata["data"][index]["id"]
|
||||
elif choice == "QQ":
|
||||
full_name = jsondata["data"][index]["song"]
|
||||
artist = jsondata["data"][index]["singer"]
|
||||
album = jsondata["data"][index]["songid"]
|
||||
elif choice == "QQ":
|
||||
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 = jsondata[index]["app"]
|
||||
songlist.insert("", "end", values=(full_name, artist, album))
|
||||
except requests.exceptions.JSONDecodeError:
|
||||
resp_text = resp.text
|
||||
@ -1327,7 +1254,7 @@ def search_local_song():
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
version = "4.3.5"
|
||||
version = "4.3.6"
|
||||
poem = ""
|
||||
appdata = os.getenv("APPDATA")
|
||||
make_resource()
|
||||
@ -1696,11 +1623,8 @@ themeLabel.place(x=10, y=25)
|
||||
|
||||
# 基本设置
|
||||
repo_dict = {
|
||||
"酷我音乐": "KUWO",
|
||||
"QQ音乐": "QQ",
|
||||
"网易云音乐": "WANGYIYUN",
|
||||
"酷狗音乐": "KUGOU",
|
||||
"聚合搜索": "JUHE"
|
||||
}
|
||||
repo_dict_reverse = {}
|
||||
for repo in repo_dict:
|
||||
|
||||
@ -3,11 +3,8 @@ usercache = {
|
||||
"theme": "sandstone",
|
||||
"path": "./music",
|
||||
"br": {
|
||||
"QQ": "HQ高音质",
|
||||
"KUWO": "高品音质",
|
||||
"WANGYIYUN": "极高音质",
|
||||
"KUGOU": "高品音质",
|
||||
"JUHE": "默认音质"
|
||||
"QQ": "余韵绕梁",
|
||||
"WANGYIYUN": "默认音质",
|
||||
},
|
||||
"choice": "QQ",
|
||||
"auto_update": True,
|
||||
@ -16,36 +13,19 @@ usercache = {
|
||||
}
|
||||
|
||||
api_data = {
|
||||
"QQ": ["https://sdkapi.hhlqilongzhu.cn/api/QQmusic/",
|
||||
"QQ": ["https://oiapi.net/api/QQ_Music",
|
||||
{
|
||||
"SQ无损": 1,
|
||||
"HQ高音质": 2,
|
||||
"标准音质": 10
|
||||
"天籁浑成": 1,
|
||||
"珠玉清华": 3,
|
||||
"余韵绕梁": 4,
|
||||
"清越穿云": 2,
|
||||
"幽微入化": 5,
|
||||
"淳和致厚": 6,
|
||||
"浊滞暗哑": 7,
|
||||
"呕哑嘲哳": 8
|
||||
}
|
||||
],
|
||||
"KUWO": ["https://sdkapi.hhlqilongzhu.cn/api/dgMusic_kuwo/",
|
||||
{
|
||||
"无损音质": 1,
|
||||
"高品音质": 2
|
||||
}
|
||||
],
|
||||
"WANGYIYUN": ["https://sdkapi.hhlqilongzhu.cn/api/dgMusic_wyy",
|
||||
{
|
||||
"标准音质": 1,
|
||||
"极高音质": 2,
|
||||
"无损音质": 3,
|
||||
"Hi-Res音质": 4,
|
||||
"高清环绕声" :5,
|
||||
"沉浸环绕声": 6,
|
||||
"超清母带": 7
|
||||
}
|
||||
],
|
||||
"KUGOU": ["https://sdkapi.hhlqilongzhu.cn/api/dgMusic_kugou/",
|
||||
{
|
||||
"高品音质": 1
|
||||
}
|
||||
],
|
||||
"JUHE": ["https://sdkapi.hhlqilongzhu.cn/api/juhe_dgmusic/",
|
||||
"WANGYIYUN": ["https://oiapi.net/api/Music_163",
|
||||
{
|
||||
"默认音质": 1
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
4.3.5
|
||||
4.3.6
|
||||
http://pan.nanfengling.cn/f/4Qc2/update.exe
|
||||
http://pan.nanfengling.cn/f/k1EhA/NFLmusicv4.3.5.exe
|
||||
http://pan.nanfengling.cn/f/qVZTK/NFLmusicv4.3.6.exe
|
||||
@ -1,5 +1,5 @@
|
||||
v4.3.5 - 2025.12.20
|
||||
修复了酷我音乐源下载音乐文件为空的问题
|
||||
v4.3.6 - 2025.01.31
|
||||
修复了音乐搜索结果为空的问题
|
||||
|
||||
本产品是南凤科技旗下的音乐下载器
|
||||
旨在提升用户体验,
|
||||
|
||||
Reference in New Issue
Block a user