比如我有 wav
flac
的无损音乐文件
我想获取到歌曲的专辑名,艺术家,专辑封面图片等
1
mercury233 2022-06-15 16:29:36 +08:00 1
关键字:ID3v2
|
2
lakehylia 2022-06-15 16:32:42 +08:00
ffmpeg
|
3
xinge666 2022-06-15 18:15:25 +08:00 via iPhone
TagLib 之前用过的用于处理音频元数据的库
https://taglib.org |
4
wudicgi 2022-06-15 23:13:56 +08:00 1
看标题我还以为是要从音频波形分析得到各个乐器的乐谱……
|
5
yaleyu 2022-06-16 16:18:53 +08:00
url = 'https://c.y.qq.com/soso/fcgi-bin/client_search_cp?ct=24&qqmusic_ver=1298&new_json=1&remoteplace=txt.yqq.song&searchid=62240638881390953&t=0&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=1&n=20&w={}&g_tk=5381&loginUin=0&hostUin=0&format=json&inCharset=utf8&outCharset=utf-8¬ice=0&platform=yqq.json&needNewCode=0'.format(urllib.parse.quote(music))
r = requests.get(url, headers=header) json_music_data = r.json() list_music = json_music_data['data']['song']['list'] title = list_music[0]['title'] album = list_music[0]['album']['title'] albumid = list_music[0]['album']['mid'] artist = list_music[0]['singer'][0]['name'] singer_amount = len(list_music[0]['singer']) if singer_amount > 1: for i in range(1, singer_amount): artist = artist + ' | ' + list_music[0]['singer'][i]['name'] cover_url = 'http://y.gtimg.cn/music/photo_new/T002R800x800M000{}.jpg'.format(albumid) urllib.request.urlretrieve(cover_url, cover_file) |
6
yaleyu 2022-06-16 16:21:06 +08:00
回复不支持 markdown ,缩进都乱了,自己调整一下吧
|
7
yaleyu 2022-06-16 16:29:38 +08:00
哎,算了,刚刚试了下,这个 QQ 音乐的接口好像挂了
|