Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
soundcloud api python获取追随者用户ID列表_Python_Api_Soundcloud - Fatal编程技术网

soundcloud api python获取追随者用户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方法?我不在

使用python和SoundCloudAPI,我如何返回追随者列表;他们的用户名和ID? 我跑

但这只会带来回报

    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'])