Compare commits
22 Commits
v4.3.0
...
bbe244e125
| Author | SHA1 | Date | |
|---|---|---|---|
| bbe244e125 | |||
| 12a8b3714c | |||
| 5ede789385 | |||
| d8a03ce0e7 | |||
| 2967b66bf8 | |||
| 9a1b04d3d5 | |||
| 99857387dc | |||
| d1aac65f25 | |||
| 08da529d84 | |||
| a47c00e991 | |||
| 8aae403c86 | |||
| 938f63a073 | |||
| 84ece943ee | |||
| 5a6e7651ed | |||
| aa5c31c257 | |||
| 7e30ddb51a | |||
| a7b76fb2fe | |||
| a237e3d73d | |||
| 33fc1144f4 | |||
| 2b931f7012 | |||
| 1849a77190 | |||
| c76ea6af80 |
2
.idea/NFLmusic.iml
generated
2
.idea/NFLmusic.iml
generated
@ -5,7 +5,7 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.6 (NFLmusic)" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.6" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -3,5 +3,5 @@
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.6 (NFLmusic)" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6 (NFLmusic)" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
107
NFLmusic.py
107
NFLmusic.py
@ -91,7 +91,6 @@ def detect_change():
|
||||
jsondata["theme"] != tmla.get(la)[var1.get()] or
|
||||
jsondata["path"] != var2.get()
|
||||
):
|
||||
|
||||
changed = True
|
||||
|
||||
|
||||
@ -187,6 +186,44 @@ def download_music(song_name, choose):
|
||||
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"]
|
||||
singer = resp.json()["data"]["singer"]
|
||||
music_url = resp.json()["data"]["url"]
|
||||
else:
|
||||
lrc = ""
|
||||
lrc = lrc.replace("\\n", "\n")
|
||||
@ -299,23 +336,35 @@ def get_data_without_blocking(song_name):
|
||||
url1 = f"{url}?gm={song_name}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3"
|
||||
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"
|
||||
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 isinstance(jsondata, dict) else jsondata)):
|
||||
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["data"][index]["title"]
|
||||
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]["songid"]
|
||||
elif choice == "QQ":
|
||||
full_name = jsondata[index]["song_title"]
|
||||
artist = jsondata[index]["song_singer"]
|
||||
album = ""
|
||||
album = jsondata[index]["app"]
|
||||
songlist.insert("", "end", values=(full_name, artist, album))
|
||||
except requests.exceptions.JSONDecodeError:
|
||||
resp_text = resp.text
|
||||
@ -386,20 +435,20 @@ def delete():
|
||||
tkinter.messagebox.showwarning(title=lang.get(la, "mbox.title.delete_fail"),
|
||||
message=lang.get(la, "mbox.text.delete_fail_no_target", ))
|
||||
except PermissionError:
|
||||
# try:
|
||||
stopmusic()
|
||||
os.remove(abs_path)
|
||||
try:
|
||||
os.remove(abs_path_lrc)
|
||||
except:
|
||||
pass
|
||||
music_dir_without_endswith.remove(listbox1.get(0, END)[listbox1.curselection()[0]])
|
||||
del music_dir[listbox1.curselection()[0]]
|
||||
listbox1.delete(listbox1.curselection()[0])
|
||||
# except Exception as e:
|
||||
# print(e, type(e))
|
||||
# tkinter.messagebox.showerror(title=lang.get(la, "mbox.title.delete_fail"),
|
||||
# message=lang.get(la, "mbox.text.delete_fail_no_permission", ))
|
||||
stopmusic()
|
||||
os.remove(abs_path)
|
||||
try:
|
||||
os.remove(abs_path_lrc)
|
||||
except:
|
||||
pass
|
||||
music_dir_without_endswith.remove(listbox1.get(0, END)[listbox1.curselection()[0]])
|
||||
del music_dir[listbox1.curselection()[0]]
|
||||
listbox1.delete(listbox1.curselection()[0])
|
||||
except Exception as e:
|
||||
print(e, type(e))
|
||||
tkinter.messagebox.showerror(title=lang.get(la, "mbox.title.delete_fail"),
|
||||
message=lang.get(la, "mbox.text.delete_fail_no_permission", ))
|
||||
except FileNotFoundError:
|
||||
tkinter.messagebox.showerror(title=lang.get(la, "mbox.title.delete_fail"),
|
||||
message=lang.get(la, "mbox.text.delete_fail_not_found", ))
|
||||
@ -448,8 +497,8 @@ def playsound(*event):
|
||||
playmusic(abs_path)
|
||||
try:
|
||||
lyric = lyrics.load_lyrics(f"{path}/{music_file_without_endswith}.lrc")
|
||||
except:
|
||||
pass
|
||||
except Exception as e:
|
||||
print(type(e), e)
|
||||
|
||||
|
||||
def playmusic(music_path):
|
||||
@ -1279,7 +1328,7 @@ def search_local_song():
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
version = "4.3.0"
|
||||
version = "4.3.4"
|
||||
poem = ""
|
||||
appdata = os.getenv("APPDATA")
|
||||
make_resource()
|
||||
@ -1641,8 +1690,10 @@ themeLabel.place(x=10, y=25)
|
||||
# 基本设置
|
||||
repo_dict = {
|
||||
"酷我音乐": "KUWO",
|
||||
"网易云音乐": "WANGYIYUN",
|
||||
"QQ音乐": "QQ",
|
||||
"网易云音乐": "WANGYIYUN",
|
||||
"酷狗音乐": "KUGOU",
|
||||
"聚合搜索": "JUHE"
|
||||
}
|
||||
repo_dict_reverse = {}
|
||||
for repo in repo_dict:
|
||||
|
||||
@ -5,12 +5,11 @@ usercache = {
|
||||
"br": {
|
||||
"QQ": "HQ高音质",
|
||||
"KUWO": "高品音质",
|
||||
"KUGOU": "HQ高品音质",
|
||||
"WANGYIYUN": "极高音质",
|
||||
"DOUYIN": "HQ高音质",
|
||||
"XIAOFEN": "高品音质"
|
||||
"KUGOU": "高品音质",
|
||||
"JUHE": "默认音质"
|
||||
},
|
||||
"choice": "KUWO",
|
||||
"choice": "QQ",
|
||||
"auto_update": True,
|
||||
"playing_mode": 0,
|
||||
"auto_play": False
|
||||
@ -20,7 +19,8 @@ api_data = {
|
||||
"QQ": ["https://sdkapi.hhlqilongzhu.cn/api/QQmusic/",
|
||||
{
|
||||
"SQ无损": 1,
|
||||
"HQ高音质": 2
|
||||
"HQ高音质": 2,
|
||||
"标准音质": 10
|
||||
}
|
||||
],
|
||||
"KUWO": ["https://sdkapi.hhlqilongzhu.cn/api/dgMusic_kuwo/",
|
||||
@ -40,6 +40,16 @@ api_data = {
|
||||
"超清母带": 7
|
||||
}
|
||||
],
|
||||
"KUGOU": ["https://sdkapi.hhlqilongzhu.cn/api/dgMusic_kugou/",
|
||||
{
|
||||
"高品音质": 1
|
||||
}
|
||||
],
|
||||
"JUHE": ["https://sdkapi.hhlqilongzhu.cn/api/juhe_dgmusic/",
|
||||
{
|
||||
"默认音质": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -13,7 +13,6 @@ def load_lyrics(file):
|
||||
timestamp = f'{minutes:02}:{seconds:02}'
|
||||
text = match.group(3)
|
||||
lyrics[timestamp] = text
|
||||
|
||||
return lyrics
|
||||
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
4.3.0
|
||||
4.3.4
|
||||
http://pan.nanfengling.cn/f/4Qc2/update.exe
|
||||
http://pan.nanfengling.cn/f/3mDtN/NFLmusicv4.3.0.exe
|
||||
http://pan.nanfengling.cn/f/ye5cZ/NFLmusicv4.3.4.exe
|
||||
@ -1,10 +1,5 @@
|
||||
v4.3.0 - 2025.8.30
|
||||
修复了QQ音乐,酷我音乐源无法使用的问题
|
||||
移除汽水音乐,小粉音乐,酷狗音乐源
|
||||
修复了音乐删除时异常弹窗的问题
|
||||
修复了路径设置异常保存的问题
|
||||
修复了部分音质无法正常播放的问题
|
||||
(其实就是换成系统关联播放器而已 (ˉ▽ˉ;)...)
|
||||
v4.3.4 - 2025.10.3
|
||||
修复了聚合搜索下载的歌词无法被正常读取的问题
|
||||
|
||||
本产品是南凤科技旗下的音乐下载器
|
||||
旨在提升用户体验,
|
||||
|
||||
Reference in New Issue
Block a user