实体展示:
由于家里没有扫描仪先凑合着看吧(
歌词本,封面待扫
下载:
123网盘:https://www.123pan.com/s/7QT3Td-1TDtd.html 提取码:ldbs
其他网盘等待补充ing…
发布页:https://nmsl.life/index.php/mcqtss/eacangel-beats-perfect-vocal-collectionwavcuelog1-71gb/
由于家里没有扫描仪先凑合着看吧(
歌词本,封面待扫
123网盘:https://www.123pan.com/s/7QT3Td-1TDtd.html 提取码:ldbs
其他网盘等待补充ing…
发布页:https://nmsl.life/index.php/mcqtss/eacangel-beats-perfect-vocal-collectionwavcuelog1-71gb/
源码,全部功能说明:https://github.com/MCQTSS/MCQTSS_QQMusic
代码仅用于学习交流
里面所有的_headers都是
{
‘Accept’: ‘*/*’,
‘Accept-Encoding’: ‘gzip, deflate, br’,
‘Accept-Language’: ‘zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6’,
‘Referer’: ‘https://y.qq.com/’,
‘User-Agent’: ‘Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X; zh-CN) AppleWebKit/537.51.1 (‘
‘KHTML, like Gecko) Mobile/17D50 UCBrowser/12.8.2.1268 Mobile AliApp(TUnionSDK/0.1.20.3) ‘
}
最开始其实是想用电脑版的,不过最后还是发现手机版的网页简单点
不过现在电脑版貌似需要登录后才能搜索
搜索代码:
def search_music(name, limit=20): # 搜索歌曲,name歌曲名,limit返回数量
print(json.dumps({
‘w’: name,
‘t’: 0,
‘n’: limit,
‘page’: 1,
‘cr’: 1,
‘new_json’: 1,
‘format’: ‘json’,
‘platform’: ‘yqq.json’
}))
return requests.get(url=’https://c.y.qq.com/soso/fcgi-bin/client_search_cp’, params={
‘w’: name,
‘t’: 0,
‘n’: limit,
‘page’: 1,
‘cr’: 1,
‘new_json’: 1,
‘format’: ‘json’,
‘platform’: ‘yqq.json’
}, timeout=1, headers=_headers).json()[‘data’][‘song’][‘list’]
除了这种记得还有这种方法
https://c.y.qq.com/soso/fcgi-bin/client_search_cp?n=长度&w=歌名
万能提交接口:https://u.y.qq.com/cgi-bin/musicu.fcg?data=xxx
网页版还有个sign=xxx的方法,没研究明白
至于能不能解析VIP歌曲,看你_cookies填的是不是有绿钻的
代码:
def get_music_url(music_mid):
uin = ''.join(random.sample('1234567890', 10))
data = {
"req": {
"module": "CDN.SrfCdnDispatchServer",
"method": "GetCdnDispatch",
"param": {
"guid": "1535153710",
"calltype": 0,
"userip": ""
}
},
"req_0": {
"module": "vkey.GetVkeyServer",
"method": "CgiGetVkey",
"param": {
"guid": "1535153710",
"songmid": [music_mid],
"songtype": [0],
"uin": uin,
"loginflag": 1,
"platform": "20",
}
},
"comm": {
"uin": uin,
"format": "json",
"ct": 24,
"cv": 0
}
}
ret = json.loads(requests.get('https://u.y.qq.com/cgi-bin/musicu.fcg?data={}'.format(json.dumps(data)),
headers=_headers, cookies=_cookies).text)
if ret['code'] == 500001:
return 'Error'
return 'https://dl.stream.qqmusic.qq.com/{}'.format(ret['req_0']['data']['midurlinfo'][0]['purl'])