soundcloud api python获取追随者用户ID列表
使用python和SoundCloudAPI,我如何返回追随者列表;他们的用户名和ID? 我跑 但这只会带来回报soundcloud api python获取追随者用户ID列表,python,api,soundcloud,Python,Api,Soundcloud,使用python和SoundCloudAPI,我如何返回追随者列表;他们的用户名和ID? 我跑 但这只会带来回报 soundcloud.resource.Resource object at NUMBER TypeError: 'Resource' object is not iterable 我尝试做的其他一切都很好,我使用用户名+密码登录方法进行身份验证并获得令牌。。。但当我试图查看追随者时,仍然只返回一个资源,而不是应该是一个资源列表 我是否使用了错误的get方法?我不在
soundcloud.resource.Resource object at NUMBER
TypeError: 'Resource' object is not iterable
我尝试做的其他一切都很好,我使用用户名+密码登录方法进行身份验证并获得令牌。。。但当我试图查看追随者时,仍然只返回一个资源,而不是应该是一个资源列表
我是否使用了错误的get方法?我不在家,但请尝试用户['id'] 编辑:对不起,错误不在那里 好的,这里有一种使用未记录api的方法,但也可以:
followers = client.get('me/followers.json')
for user in followers:
print(user.username,user.id)
或
我仍然得到“TypeError:‘Resource’object is not iterable”错误,尽管资源编号不同。
followers = client.get('me/followers.json')
for user in followers:
print(user.username,user.id)
followers = client.get('me/followers').collection
for user in followers:
print(user.obj['username'],user.obj['id'])
followers = client.get('me/followers').obj["collection"]
for user in followers:
print(user['username'],user['id'])