修复140行报错问题

This commit is contained in:
苏晓晴 2023-09-23 23:55:16 +08:00 committed by GitHub
parent 6d843d8107
commit d3f9d8e631
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,12 +137,14 @@ def Song_v1():
params = HexDigest(enc)
# 发送POST请求
response = post(url, params, cookies)
if "参数错误" in response:
return jsonify({"status": 400,'msg': '参数错误!'}), 400
jseg = json.loads(response)
song_names = "https://music.163.com/api/v3/song/detail"
data = {'c': json.dumps([{"id":jseg['data'][0]['id'],"v":0}])}
resp = requests.post(url=song_names, data=data)
jse = json.loads(resp.text)
if jseg['data'][0]['url'] is not None:
if jse['songs']:
song_url = jseg['data'][0]['url']