Compare commits
36 Commits
v4.2.7
...
240f380026
| Author | SHA1 | Date | |
|---|---|---|---|
| 240f380026 | |||
| 4e55f0521f | |||
| f95335e39f | |||
| 3ac2c59dcd | |||
| 5189898b6b | |||
| 76392863ad | |||
| 64bba311ae | |||
| d94318b3b9 | |||
| dad7043db7 | |||
| bbe244e125 | |||
| 12a8b3714c | |||
| 5ede789385 | |||
| d8a03ce0e7 | |||
| 2967b66bf8 | |||
| 9a1b04d3d5 | |||
| 99857387dc | |||
| d1aac65f25 | |||
| 08da529d84 | |||
| a47c00e991 | |||
| 8aae403c86 | |||
| 938f63a073 | |||
| 84ece943ee | |||
| 5a6e7651ed | |||
| aa5c31c257 | |||
| 7e30ddb51a | |||
| a7b76fb2fe | |||
| a237e3d73d | |||
| 33fc1144f4 | |||
| 2b931f7012 | |||
| 1849a77190 | |||
| c76ea6af80 | |||
| 43ad0fa955 | |||
| 9e424631a9 | |||
| ea0cc35f84 | |||
| 8fd22e05d2 | |||
| a59ea236d5 |
3
.idea/NFLmusic.iml
generated
3
.idea/NFLmusic.iml
generated
@ -4,8 +4,9 @@
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv1" />
|
||||
</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>
|
||||
165
NFLmusic.py
165
NFLmusic.py
@ -1,5 +1,4 @@
|
||||
import time
|
||||
from functools import total_ordering
|
||||
from tkinter import *
|
||||
import threading
|
||||
import pygame
|
||||
@ -91,7 +90,6 @@ def detect_change():
|
||||
jsondata["theme"] != tmla.get(la)[var1.get()] or
|
||||
jsondata["path"] != var2.get()
|
||||
):
|
||||
|
||||
changed = True
|
||||
|
||||
|
||||
@ -127,7 +125,7 @@ def download_check(*value):
|
||||
|
||||
|
||||
def download_music(song_name, choose):
|
||||
global progressbar, downloading
|
||||
global progressbar, downloading, headers
|
||||
|
||||
def update_progressbar():
|
||||
while True:
|
||||
@ -142,89 +140,38 @@ 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")
|
||||
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}")
|
||||
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":
|
||||
resp = requests.get(f"{url}?gm={song_name}&n={choose}&num=60&type=json&quality={br}")
|
||||
resp.close()
|
||||
try:
|
||||
lrc = resp.json()["lyrics"]
|
||||
except Exception as e:
|
||||
print(f"download_kugou_lrc: {e}")
|
||||
lrc = ""
|
||||
music_name = resp.json()["title"]
|
||||
singer = resp.json()["singer"]
|
||||
music_url = resp.json()["music_url"]
|
||||
elif choice == "DOUYIN":
|
||||
resp = requests.get(f"{url}?msg={song_name}&n={choose}&num=50&type=json")
|
||||
resp.close()
|
||||
try:
|
||||
lrc = resp.json()["data"]["lrc"]
|
||||
except Exception as e:
|
||||
print(f"download_qishui_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"]
|
||||
elif choice == "XIAOFEN":
|
||||
resp = requests.get(f"{url}?msg={song_name}&n={choose}&num=60&type=json&br={br}")
|
||||
resp.close()
|
||||
try:
|
||||
lrc = resp.json()["lrc"]
|
||||
except Exception as e:
|
||||
print(f"download_xiaofen_lrc: {e}")
|
||||
lrc = ""
|
||||
music_name = resp.json()["title"]
|
||||
singer = resp.json()["singer"]
|
||||
music_url = resp.json()["music_url"]
|
||||
music_url = resp.json()["data"]["music"]
|
||||
else:
|
||||
lrc = ""
|
||||
lrc = lrc.replace("\\n", "\n")
|
||||
print("请求api:", url)
|
||||
response = requests.get(music_url, stream=True)
|
||||
response = requests.get(music_url, stream=True, headers=headers)
|
||||
print("下载直链:", music_url)
|
||||
formated = music_url.split("?")[0].rsplit(".", 1)[1]
|
||||
if formated not in ["m4a", "mp3", "ogg", "flac"]:
|
||||
@ -283,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 == "":
|
||||
@ -326,47 +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"
|
||||
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"
|
||||
elif choice == "KUGOU":
|
||||
url1 = f"{url}?gm={song_name}&num=60&type=json"
|
||||
elif choice == "DOUYIN":
|
||||
url1 = f"{url}?msg={song_name}&num=50&type=json"
|
||||
elif choice == "XIAOFEN":
|
||||
url1 = f"{url}?msg={song_name}&num=60&type=json"
|
||||
url1 = f"{url}?msg={song_name}&limit=60&type=json&key=oiapi-e3329f47-ccbc-2279-14b6-eabd4c7286ac"
|
||||
resp = requests.get(url1)
|
||||
jsondata = resp.json()["data"]
|
||||
jsondata = resp.json()
|
||||
resp.close()
|
||||
last_search_target = song_name
|
||||
for index in range(len(jsondata)):
|
||||
if choice == "KUWO":
|
||||
full_name = jsondata[index]["songname"]
|
||||
artist = jsondata[index]["singer"]
|
||||
album = jsondata[index]["song_rid"]
|
||||
elif choice == "WANGYIYUN":
|
||||
full_name = jsondata[index]["title"]
|
||||
artist = jsondata[index]["singer"]
|
||||
album = jsondata[index]["songid"]
|
||||
for index in range(len(jsondata["data"] if isinstance(jsondata, dict) else jsondata)):
|
||||
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[index]["song_title"]
|
||||
artist = jsondata[index]["song_singer"]
|
||||
album = ""
|
||||
elif choice == "KUGOU":
|
||||
full_name = jsondata[index]["title"]
|
||||
artist = jsondata[index]["singer"]
|
||||
album = ""
|
||||
elif choice == "DOUYIN":
|
||||
full_name = jsondata[index]["title"]
|
||||
artist = jsondata[index]["singer"]
|
||||
album = ""
|
||||
elif choice == "XIAOFEN":
|
||||
full_name = jsondata[index]["title"]
|
||||
artist = jsondata[index]["singer"]
|
||||
album = ""
|
||||
full_name = jsondata["data"][index]["song"]
|
||||
artist = jsondata["data"][index]["singer"]
|
||||
album = jsondata["data"][index]["songid"]
|
||||
songlist.insert("", "end", values=(full_name, artist, album))
|
||||
except requests.exceptions.JSONDecodeError:
|
||||
resp_text = resp.text
|
||||
@ -444,10 +368,11 @@ def delete():
|
||||
os.remove(abs_path_lrc)
|
||||
except:
|
||||
pass
|
||||
music_dir_without_endswith.remove(filtered_list[listbox1.curselection()[0]])
|
||||
music_dir.remove(music_dir[listbox1.curselection()[0]])
|
||||
music_dir_without_endswith.remove(listbox1.get(0, END)[listbox1.curselection()[0]])
|
||||
del music_dir[listbox1.curselection()[0]]
|
||||
listbox1.delete(listbox1.curselection()[0])
|
||||
except:
|
||||
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:
|
||||
@ -498,8 +423,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):
|
||||
@ -511,9 +436,7 @@ def playmusic(music_path):
|
||||
try:
|
||||
music_player.play_music(music_path)
|
||||
except pygame.error:
|
||||
tkinter.messagebox.showerror(title=lang.get(la, "mbox.title.play_fail"),
|
||||
message=lang.get(la, "mbox.text.play_fail_unrecognized_format",
|
||||
{"_file_": music_name}))
|
||||
os.startfile(music_path)
|
||||
except:
|
||||
pass
|
||||
|
||||
@ -1331,7 +1254,7 @@ def search_local_song():
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
version = "4.2.7"
|
||||
version = "4.3.6"
|
||||
poem = ""
|
||||
appdata = os.getenv("APPDATA")
|
||||
make_resource()
|
||||
@ -1436,6 +1359,14 @@ playingmode_dict = {
|
||||
1: "rand",
|
||||
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 os.path.exists("./music"):
|
||||
@ -1692,12 +1623,8 @@ themeLabel.place(x=10, y=25)
|
||||
|
||||
# 基本设置
|
||||
repo_dict = {
|
||||
"酷我音乐": "KUWO",
|
||||
"网易云音乐": "WANGYIYUN",
|
||||
"QQ音乐": "QQ",
|
||||
"酷狗音乐": "KUGOU",
|
||||
"汽水音乐": "DOUYIN",
|
||||
"小粉音乐": "XIAOFEN"
|
||||
"网易云音乐": "WANGYIYUN",
|
||||
}
|
||||
repo_dict_reverse = {}
|
||||
for repo in repo_dict:
|
||||
|
||||
@ -3,63 +3,33 @@ usercache = {
|
||||
"theme": "sandstone",
|
||||
"path": "./music",
|
||||
"br": {
|
||||
"QQ": "HQ高音质",
|
||||
"KUWO": "高品音质",
|
||||
"KUGOU": "HQ高品音质",
|
||||
"WANGYIYUN": "极高音质",
|
||||
"DOUYIN": "HQ高音质",
|
||||
"XIAOFEN": "高品音质"
|
||||
"QQ": "余韵绕梁",
|
||||
"WANGYIYUN": "默认音质",
|
||||
},
|
||||
"choice": "KUWO",
|
||||
"choice": "QQ",
|
||||
"auto_update": True,
|
||||
"playing_mode": 0,
|
||||
"auto_play": False
|
||||
}
|
||||
|
||||
api_data = {
|
||||
"QQ": ["https://www.hhlqilongzhu.cn/api/dg_QQmusicflac.php",
|
||||
"QQ": ["https://oiapi.net/api/QQ_Music",
|
||||
{
|
||||
"臻品母带": 10,
|
||||
"SQ无损": 1,
|
||||
"HQ高音质": 2
|
||||
"天籁浑成": 1,
|
||||
"珠玉清华": 3,
|
||||
"余韵绕梁": 4,
|
||||
"清越穿云": 2,
|
||||
"幽微入化": 5,
|
||||
"淳和致厚": 6,
|
||||
"浊滞暗哑": 7,
|
||||
"呕哑嘲哳": 8
|
||||
}
|
||||
],
|
||||
"KUWO": ["https://www.hhlqilongzhu.cn/api/dg_kuwomusic.php",
|
||||
"WANGYIYUN": ["https://oiapi.net/api/Music_163",
|
||||
{
|
||||
"无损音质": 1,
|
||||
"高品音质": 2,
|
||||
"默认音质": 1
|
||||
}
|
||||
],
|
||||
"KUGOU": ["https://www.hhlqilongzhu.cn/api/dg_kgmusic.php",
|
||||
{
|
||||
"蝰蛇全景声": "viper_atmos",
|
||||
"无损音质": "flac",
|
||||
"HQ高品音质": 320,
|
||||
"标准音质": 128
|
||||
}
|
||||
],
|
||||
"WANGYIYUN": ["https://sdkapi.hhlqilongzhu.cn/api/dgMusic_wyy",
|
||||
{
|
||||
"标准音质": 1,
|
||||
"极高音质": 2,
|
||||
"无损音质": 3,
|
||||
"Hi-Res音质": 4,
|
||||
"高清环绕声" :5,
|
||||
"沉浸环绕声": 6,
|
||||
"超清母带": 7
|
||||
}
|
||||
],
|
||||
"DOUYIN": ["https://www.hhlqilongzhu.cn/api/dg_douyinmusic.php",
|
||||
{
|
||||
"HQ高音质": 2,
|
||||
}
|
||||
],
|
||||
"XIAOFEN": ["https://www.hhlqilongzhu.cn/api/dg_mgmusic_24bit.php",
|
||||
{
|
||||
"无损音质": 1,
|
||||
"高品音质": 2,
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -13,7 +13,6 @@ def load_lyrics(file):
|
||||
timestamp = f'{minutes:02}:{seconds:02}'
|
||||
text = match.group(3)
|
||||
lyrics[timestamp] = text
|
||||
|
||||
return lyrics
|
||||
|
||||
|
||||
|
||||
16
test.py
Normal file
16
test.py
Normal file
@ -0,0 +1,16 @@
|
||||
import requests
|
||||
|
||||
url = "https://er-sycdn.kuwo.cn/5a1fdd7e1178a867af57c6b0ba576889/69468dc3/resource/30106/trackmedia/F000000bYDlc2XxKLs.flac"
|
||||
|
||||
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.2.7
|
||||
4.3.6
|
||||
http://pan.nanfengling.cn/f/4Qc2/update.exe
|
||||
http://pan.nanfengling.cn/f/MdkhO/NFLmusicv4.2.7.exe
|
||||
http://pan.nanfengling.cn/f/qVZTK/NFLmusicv4.3.6.exe
|
||||
@ -1,5 +1,5 @@
|
||||
v4.2.7 - 2025.6.9
|
||||
修复了网易云音乐下载源无法正常使用的问题
|
||||
v4.3.6 - 2025.01.31
|
||||
修复了音乐搜索结果为空的问题
|
||||
|
||||
本产品是南凤科技旗下的音乐下载器
|
||||
旨在提升用户体验,
|
||||
|
||||
Reference in New Issue
Block a user