mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-Nonebot.git
synced 2026-04-01 22:04:51 +00:00
音乐登陆失效异常处理
This commit is contained in:
parent
ef812ebba1
commit
ad241b3ad6
1 changed files with 3 additions and 0 deletions
|
|
@ -172,6 +172,9 @@ def netease_music_download(song_id,song_name,singer,session):
|
|||
download_url = 'https://music.163.com/weapi/song/enhance/player/url/v1?br=999000'
|
||||
url = session.post(download_url, headers=headers,data=data).json()['data'][0]['url']
|
||||
|
||||
if url is None:
|
||||
return -1
|
||||
|
||||
#下载歌曲
|
||||
data = requests.get(url, stream=True)
|
||||
file_path = os.path.join(save_path, f"{song_name}-{singer}.wav")
|
||||
|
|
|
|||
Loading…
Reference in a new issue