Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kuwo源配置kuwodes时报错 #37

Closed
wang-zhix opened this issue Jan 31, 2024 · 6 comments
Closed

kuwo源配置kuwodes时报错 #37

wang-zhix opened this issue Jan 31, 2024 · 6 comments

Comments

@wang-zhix
Copy link
Contributor

image
第一次循环之后,不应该重新在body中取值

应该这样修正
image

同时接口返回值中的bitrate就是1,但下面判断了==1 将raise failed 不知是不是有意为之

@helloplhm-qwq
Copy link
Collaborator

据我所知bitrate=1的时候接口返回的是"您所播放的内容续开通会员后畅听"

不过你这样的修正不应该会引起重复调用吗,body调用get方法不会修改自身,在python中,在for循环中定义的变量离开for循环依旧可以使用

你光说个报错我咋知道为啥报错,请提供日志,谢谢你

@wang-zhix
Copy link
Contributor Author

第一次循环p的值是'data' 从body中取body['data'] 第二次循环p的值是'url' 应该从body['data']里取data['url'] 肯定不能再从body中取url了呀
报错肯定报key不存在呀

@wang-zhix
Copy link
Contributor Author

用了get 就永远返回是None了

@wang-zhix
Copy link
Contributor Author

bitrate=1 的问题 我没测试完全 抱歉。 确实是返回了"您所播放的内容续开通会员后畅听"

@wang-zhix
Copy link
Contributor Author

body = {
'data': {
'url' : 'http://**.mp3'
}
}

for p in ['data', 'url']:
body.get(p)

想要的应该是body['data']['url']

但这个代码却是 第一次循环body['data'] 第二次循环body['url'] body肯定没有这个key呀

@helloplhm-qwq
Copy link
Collaborator

懂了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants