Compare commits
6 Commits
99857387dc
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| bbe244e125 | |||
| 12a8b3714c | |||
| 5ede789385 | |||
| d8a03ce0e7 | |||
| 2967b66bf8 | |||
| 9a1b04d3d5 |
24
NFLmusic.py
24
NFLmusic.py
@ -204,6 +204,20 @@ def download_music(song_name, choose):
|
||||
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 = ""
|
||||
@ -325,12 +339,12 @@ def get_data_without_blocking(song_name):
|
||||
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"
|
||||
url1 = f"{url}?msg={song_name}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3"
|
||||
resp = requests.get(url1)
|
||||
jsondata = resp.json()
|
||||
resp.close()
|
||||
last_search_target = song_name
|
||||
for index in range(len(jsondata["data"])):
|
||||
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"]
|
||||
@ -483,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):
|
||||
@ -1314,7 +1328,7 @@ def search_local_song():
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
version = "4.3.3"
|
||||
version = "4.3.4"
|
||||
poem = ""
|
||||
appdata = os.getenv("APPDATA")
|
||||
make_resource()
|
||||
|
||||
@ -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.3
|
||||
4.3.4
|
||||
http://pan.nanfengling.cn/f/4Qc2/update.exe
|
||||
http://pan.nanfengling.cn/f/bBXfv/NFLmusicv4.3.3.exe
|
||||
http://pan.nanfengling.cn/f/ye5cZ/NFLmusicv4.3.4.exe
|
||||
@ -1,5 +1,5 @@
|
||||
v4.3.3 - 2025.10.3
|
||||
新增了聚合音乐搜索下载源
|
||||
v4.3.4 - 2025.10.3
|
||||
修复了聚合搜索下载的歌词无法被正常读取的问题
|
||||
|
||||
本产品是南凤科技旗下的音乐下载器
|
||||
旨在提升用户体验,
|
||||
|
||||
Reference in New Issue
Block a user