Skip to content

Commit

Permalink
fix: kuwo KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
helloplhm-qwq committed Jan 13, 2024
1 parent 21d19d6 commit c8202f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/kw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ async def url(songId, quality):
body = req.json()
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')

return {
'url': data['url'].split('?')[0],
'quality': tools['qualityMapReverse'][data['audioInfo']['bitrate']]
'quality': tools['qualityMapReverse'][int(data['audioInfo']['bitrate'])]
}
except:
raise FailedException('failed')
Expand Down

0 comments on commit c8202f7

Please sign in to comment.