Compare commits
19 Commits
v4.3.2
...
5189898b6b
| Author | SHA1 | Date | |
|---|---|---|---|
| 5189898b6b | |||
| 76392863ad | |||
| 64bba311ae | |||
| d94318b3b9 | |||
| dad7043db7 | |||
| bbe244e125 | |||
| 12a8b3714c | |||
| 5ede789385 | |||
| d8a03ce0e7 | |||
| 2967b66bf8 | |||
| 9a1b04d3d5 | |||
| 99857387dc | |||
| d1aac65f25 | |||
| 08da529d84 | |||
| a47c00e991 | |||
| 8aae403c86 | |||
| 938f63a073 | |||
| 84ece943ee | |||
| 5a6e7651ed |
3
.idea/NFLmusic.iml
generated
3
.idea/NFLmusic.iml
generated
@ -4,8 +4,9 @@
|
|||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.venv1" />
|
||||||
</content>
|
</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" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -3,5 +3,5 @@
|
|||||||
<component name="Black">
|
<component name="Black">
|
||||||
<option name="sdkName" value="Python 3.6 (NFLmusic)" />
|
<option name="sdkName" value="Python 3.6 (NFLmusic)" />
|
||||||
</component>
|
</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>
|
</project>
|
||||||
74
NFLmusic.py
74
NFLmusic.py
@ -1,5 +1,4 @@
|
|||||||
import time
|
import time
|
||||||
from functools import total_ordering
|
|
||||||
from tkinter import *
|
from tkinter import *
|
||||||
import threading
|
import threading
|
||||||
import pygame
|
import pygame
|
||||||
@ -126,7 +125,7 @@ def download_check(*value):
|
|||||||
|
|
||||||
|
|
||||||
def download_music(song_name, choose):
|
def download_music(song_name, choose):
|
||||||
global progressbar, downloading
|
global progressbar, downloading, headers
|
||||||
|
|
||||||
def update_progressbar():
|
def update_progressbar():
|
||||||
while True:
|
while True:
|
||||||
@ -198,11 +197,37 @@ def download_music(song_name, choose):
|
|||||||
music_name = resp.json()["title"]
|
music_name = resp.json()["title"]
|
||||||
singer = resp.json()["singer"]
|
singer = resp.json()["singer"]
|
||||||
music_url = resp.json()["music_url"]
|
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:
|
else:
|
||||||
lrc = ""
|
lrc = ""
|
||||||
lrc = lrc.replace("\\n", "\n")
|
lrc = lrc.replace("\\n", "\n")
|
||||||
print("请求api:", url)
|
print("请求api:", url)
|
||||||
response = requests.get(music_url, stream=True)
|
response = requests.get(music_url, stream=True, headers=headers)
|
||||||
print("下载直链:", music_url)
|
print("下载直链:", music_url)
|
||||||
formated = music_url.split("?")[0].rsplit(".", 1)[1]
|
formated = music_url.split("?")[0].rsplit(".", 1)[1]
|
||||||
if formated not in ["m4a", "mp3", "ogg", "flac"]:
|
if formated not in ["m4a", "mp3", "ogg", "flac"]:
|
||||||
@ -311,28 +336,34 @@ def get_data_without_blocking(song_name):
|
|||||||
elif choice == "QQ":
|
elif choice == "QQ":
|
||||||
url1 = f"{url}?msg={song_name}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3"
|
url1 = f"{url}?msg={song_name}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3"
|
||||||
elif choice == "KUGOU":
|
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}&num=60&type=json&key=Dragon5B887C2DC41AD03C93F06BAF4B7888C3"
|
||||||
resp = requests.get(url1)
|
resp = requests.get(url1)
|
||||||
jsondata = resp.json()["data"]
|
jsondata = resp.json()
|
||||||
resp.close()
|
resp.close()
|
||||||
last_search_target = song_name
|
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":
|
if choice == "KUWO":
|
||||||
full_name = jsondata[index]["songname"]
|
full_name = jsondata["data"][index]["songname"]
|
||||||
artist = jsondata[index]["singer"]
|
artist = jsondata["data"][index]["singer"]
|
||||||
album = jsondata[index]["song_rid"]
|
album = jsondata["data"][index]["song_rid"]
|
||||||
elif choice == "WANGYIYUN":
|
elif choice == "WANGYIYUN":
|
||||||
full_name = jsondata[index]["title"]
|
full_name = jsondata["data"][index]["title"]
|
||||||
artist = jsondata[index]["singer"]
|
artist = jsondata["data"][index]["singer"]
|
||||||
album = jsondata[index]["songid"]
|
album = jsondata["data"][index]["songid"]
|
||||||
elif choice == "QQ":
|
elif choice == "QQ":
|
||||||
full_name = jsondata[index]["song_title"]
|
full_name = jsondata["data"][index]["song_title"]
|
||||||
artist = jsondata[index]["song_singer"]
|
artist = jsondata["data"][index]["song_singer"]
|
||||||
album = ""
|
album = ""
|
||||||
elif choice == "KUGOU":
|
elif choice == "KUGOU":
|
||||||
|
full_name = jsondata["data"][index]["title"]
|
||||||
|
artist = jsondata["data"][index]["singer"]
|
||||||
|
album = ""
|
||||||
|
elif choice == "JUHE":
|
||||||
full_name = jsondata[index]["title"]
|
full_name = jsondata[index]["title"]
|
||||||
artist = jsondata[index]["singer"]
|
artist = jsondata[index]["singer"]
|
||||||
album = ""
|
album = jsondata[index]["app"]
|
||||||
songlist.insert("", "end", values=(full_name, artist, album))
|
songlist.insert("", "end", values=(full_name, artist, album))
|
||||||
except requests.exceptions.JSONDecodeError:
|
except requests.exceptions.JSONDecodeError:
|
||||||
resp_text = resp.text
|
resp_text = resp.text
|
||||||
@ -465,8 +496,8 @@ def playsound(*event):
|
|||||||
playmusic(abs_path)
|
playmusic(abs_path)
|
||||||
try:
|
try:
|
||||||
lyric = lyrics.load_lyrics(f"{path}/{music_file_without_endswith}.lrc")
|
lyric = lyrics.load_lyrics(f"{path}/{music_file_without_endswith}.lrc")
|
||||||
except:
|
except Exception as e:
|
||||||
pass
|
print(type(e), e)
|
||||||
|
|
||||||
|
|
||||||
def playmusic(music_path):
|
def playmusic(music_path):
|
||||||
@ -1296,7 +1327,7 @@ def search_local_song():
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
|
||||||
version = "4.3.2"
|
version = "4.3.5"
|
||||||
poem = ""
|
poem = ""
|
||||||
appdata = os.getenv("APPDATA")
|
appdata = os.getenv("APPDATA")
|
||||||
make_resource()
|
make_resource()
|
||||||
@ -1401,6 +1432,14 @@ playingmode_dict = {
|
|||||||
1: "rand",
|
1: "rand",
|
||||||
2: "sequ"
|
2: "sequ"
|
||||||
}
|
}
|
||||||
|
headers = {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
|
||||||
|
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
|
||||||
|
'Accept-Language': 'en-US,en;q=0.5',
|
||||||
|
'Accept-Encoding': 'gzip, deflate',
|
||||||
|
'Connection': 'keep-alive',
|
||||||
|
'Upgrade-Insecure-Requests': '1',
|
||||||
|
}
|
||||||
|
|
||||||
if path == "./music":
|
if path == "./music":
|
||||||
if os.path.exists("./music"):
|
if os.path.exists("./music"):
|
||||||
@ -1661,6 +1700,7 @@ repo_dict = {
|
|||||||
"QQ音乐": "QQ",
|
"QQ音乐": "QQ",
|
||||||
"网易云音乐": "WANGYIYUN",
|
"网易云音乐": "WANGYIYUN",
|
||||||
"酷狗音乐": "KUGOU",
|
"酷狗音乐": "KUGOU",
|
||||||
|
"聚合搜索": "JUHE"
|
||||||
}
|
}
|
||||||
repo_dict_reverse = {}
|
repo_dict_reverse = {}
|
||||||
for repo in repo_dict:
|
for repo in repo_dict:
|
||||||
|
|||||||
@ -6,9 +6,10 @@ usercache = {
|
|||||||
"QQ": "HQ高音质",
|
"QQ": "HQ高音质",
|
||||||
"KUWO": "高品音质",
|
"KUWO": "高品音质",
|
||||||
"WANGYIYUN": "极高音质",
|
"WANGYIYUN": "极高音质",
|
||||||
"KUGOU": "高品音质"
|
"KUGOU": "高品音质",
|
||||||
|
"JUHE": "默认音质"
|
||||||
},
|
},
|
||||||
"choice": "KUWO",
|
"choice": "QQ",
|
||||||
"auto_update": True,
|
"auto_update": True,
|
||||||
"playing_mode": 0,
|
"playing_mode": 0,
|
||||||
"auto_play": False
|
"auto_play": False
|
||||||
@ -43,6 +44,11 @@ api_data = {
|
|||||||
{
|
{
|
||||||
"高品音质": 1
|
"高品音质": 1
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"JUHE": ["https://sdkapi.hhlqilongzhu.cn/api/juhe_dgmusic/",
|
||||||
|
{
|
||||||
|
"默认音质": 1
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,6 @@ def load_lyrics(file):
|
|||||||
timestamp = f'{minutes:02}:{seconds:02}'
|
timestamp = f'{minutes:02}:{seconds:02}'
|
||||||
text = match.group(3)
|
text = match.group(3)
|
||||||
lyrics[timestamp] = text
|
lyrics[timestamp] = text
|
||||||
|
|
||||||
return lyrics
|
return lyrics
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
18
test.py
18
test.py
@ -1,4 +1,16 @@
|
|||||||
import os
|
import requests
|
||||||
|
|
||||||
audio_file = "C:/Users/Administrator/Music/国风堂#哦漏 - 知我.mp3"
|
url = "https://er-sycdn.kuwo.cn/5a1fdd7e1178a867af57c6b0ba576889/69468dc3/resource/30106/trackmedia/F000000bYDlc2XxKLs.flac"
|
||||||
os.startfile(audio_file)
|
|
||||||
|
headers = {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
|
||||||
|
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
|
||||||
|
'Accept-Language': 'en-US,en;q=0.5',
|
||||||
|
'Accept-Encoding': 'gzip, deflate',
|
||||||
|
'Connection': 'keep-alive',
|
||||||
|
'Upgrade-Insecure-Requests': '1',
|
||||||
|
}
|
||||||
|
|
||||||
|
total_length = int(requests.get(url, stream=True, headers=headers).headers.get('content-length'))
|
||||||
|
|
||||||
|
print(total_length)
|
||||||
@ -1,3 +1,3 @@
|
|||||||
4.3.2
|
4.3.5
|
||||||
http://pan.nanfengling.cn/f/4Qc2/update.exe
|
http://pan.nanfengling.cn/f/4Qc2/update.exe
|
||||||
http://pan.nanfengling.cn/f/pvdsV/NFLmusicv4.3.2.exe
|
http://pan.nanfengling.cn/f/k1EhA/NFLmusicv4.3.5.exe
|
||||||
@ -1,6 +1,5 @@
|
|||||||
v4.3.2 - 2025.9.6
|
v4.3.5 - 2025.12.20
|
||||||
新增酷狗音乐下载源
|
修复了酷我音乐源下载音乐文件为空的问题
|
||||||
修复部分已知问题
|
|
||||||
|
|
||||||
本产品是南凤科技旗下的音乐下载器
|
本产品是南凤科技旗下的音乐下载器
|
||||||
旨在提升用户体验,
|
旨在提升用户体验,
|
||||||
|
|||||||
Reference in New Issue
Block a user