mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-Nonebot.git
synced 2026-04-01 22:04:51 +00:00
调整转换silk 文件参数
This commit is contained in:
parent
ed29f8ca34
commit
94c2f3d0e1
1 changed files with 3 additions and 3 deletions
|
|
@ -172,8 +172,8 @@ def netease_music_download(song_id,song_name,singer,session):
|
||||||
url = session.post(download_url, headers=headers,data=data).json()['data'][0]['url']
|
url = session.post(download_url, headers=headers,data=data).json()['data'][0]['url']
|
||||||
#下载歌曲
|
#下载歌曲
|
||||||
data = requests.get(url, stream=True)
|
data = requests.get(url, stream=True)
|
||||||
file_path = os.path.join(save_path, f"{song_name}-{singer}.mp3")
|
file_path = os.path.join(save_path, f"{song_name}-{singer}.wav")
|
||||||
file_name = os.path.basename(f"{song_name}-{singer}.mp3")
|
file_name = os.path.basename(f"{song_name}-{singer}.wav")
|
||||||
with open(file_path, "wb") as f:
|
with open(file_path, "wb") as f:
|
||||||
f.write(data.content)
|
f.write(data.content)
|
||||||
if data.status_code == 200:
|
if data.status_code == 200:
|
||||||
|
|
@ -182,7 +182,7 @@ def netease_music_download(song_id,song_name,singer,session):
|
||||||
file.write(chunk)
|
file.write(chunk)
|
||||||
output_silk_path = os.path.join(save_path, os.path.splitext(file_name)[0] + ".silk")
|
output_silk_path = os.path.join(save_path, os.path.splitext(file_name)[0] + ".silk")
|
||||||
# 使用 graiax-silkcoder 进行转换
|
# 使用 graiax-silkcoder 进行转换
|
||||||
silkcoder.encode(file_path, output_silk_path)
|
silkcoder.encode(file_path, output_silk_path,tencent=True,ios_adaptive=True)
|
||||||
return output_silk_path
|
return output_silk_path
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue