mirror of
https://github.com/MeoProject/lx-music-api-server.git
synced 2025-05-23 19:17:41 +08:00
fix: kuwo KeyError
This commit is contained in:
parent
21d19d6af7
commit
c8202f773e
@ -55,12 +55,12 @@ async def url(songId, quality):
|
|||||||
body = req.json()
|
body = req.json()
|
||||||
data = body['data']
|
data = body['data']
|
||||||
|
|
||||||
if (body['code'] != 200) or (data['audioInfo']['bitrate'] == 1):
|
if (body['code'] != 200) or (int(data['audioInfo']['bitrate']) == 1):
|
||||||
raise FailedException('failed')
|
raise FailedException('failed')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'url': data['url'].split('?')[0],
|
'url': data['url'].split('?')[0],
|
||||||
'quality': tools['qualityMapReverse'][data['audioInfo']['bitrate']]
|
'quality': tools['qualityMapReverse'][int(data['audioInfo']['bitrate'])]
|
||||||
}
|
}
|
||||||
except:
|
except:
|
||||||
raise FailedException('failed')
|
raise FailedException('failed')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user