mirror of
https://github.com/Suxiaoqinx/Netease_url.git
synced 2025-07-14 05:12:21 +08:00
修复140行报错问题
This commit is contained in:
parent
6d843d8107
commit
d3f9d8e631
4
main.py
4
main.py
@ -137,12 +137,14 @@ def Song_v1():
|
|||||||
params = HexDigest(enc)
|
params = HexDigest(enc)
|
||||||
# 发送POST请求
|
# 发送POST请求
|
||||||
response = post(url, params, cookies)
|
response = post(url, params, cookies)
|
||||||
|
if "参数错误" in response:
|
||||||
|
return jsonify({"status": 400,'msg': '参数错误!'}), 400
|
||||||
|
|
||||||
jseg = json.loads(response)
|
jseg = json.loads(response)
|
||||||
song_names = "https://music.163.com/api/v3/song/detail"
|
song_names = "https://music.163.com/api/v3/song/detail"
|
||||||
data = {'c': json.dumps([{"id":jseg['data'][0]['id'],"v":0}])}
|
data = {'c': json.dumps([{"id":jseg['data'][0]['id'],"v":0}])}
|
||||||
resp = requests.post(url=song_names, data=data)
|
resp = requests.post(url=song_names, data=data)
|
||||||
jse = json.loads(resp.text)
|
jse = json.loads(resp.text)
|
||||||
|
|
||||||
if jseg['data'][0]['url'] is not None:
|
if jseg['data'][0]['url'] is not None:
|
||||||
if jse['songs']:
|
if jse['songs']:
|
||||||
song_url = jseg['data'][0]['url']
|
song_url = jseg['data'][0]['url']
|
||||||
|
Loading…
Reference in New Issue
Block a user