Soundcloud API 在某些轨道上返回 403 [英] Soundcloud API is returning 403 on some tracks

查看:35
本文介绍了Soundcloud API 在某些轨道上返回 403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Soundclouds API 在某些曲目上为我返回 403.我试过使用原始 http 端点和 python 的 soundcloud api 包装器,两者都有问题.

Soundclouds API is returning 403 on some tracks for me. I have tried playing with the raw http endpoints and also the soundcloud api wrapper for python, both have the issue.

https://api.soundcloud.com/tracks/251164884.json?client_id=CLIENT_ID

上面一个返回403错误,下面一个工作,显然使用相同的CLIENT_ID

The above one returns a 403 error while below one works, using same CLIENT_ID obviously

https://api.soundcloud.com/tracks/197355235.json?client_id=CLIENT_ID

使用我得到的库包装器.requests.exceptions.HTTPError:403 客户端错误:禁止

Using the library wrapper I get. requests.exceptions.HTTPError: 403 Client Error: Forbidden

    import soundcloud
    client = soundcloud.Client(client_id=CLIENT_ID)
    track = client.get('/resolve', url='https://soundcloud.com/mtarecords/my-nu-leng-flava-d-soul-shake') 

https://soundcloud.com/calyxteebee/nothing-left另一个也无法解析的曲目.并非所有曲目都有这个问题,大多数曲目都是如此.

https://soundcloud.com/calyxteebee/nothing-left Another track that also doesn't resolve. Not all tracks have this issue, most work how they always have.

如果您转到 Share -> Embed on Soundcloud,track_id 将在其中,所以我知道我使用的是正确的 track_id.

If you go to the Share -> Embed on Soundcloud the track_id will be in there, so I know I am using the correct track_id.

在浏览器中查看 http 端点时出现错误.

Viewing the http endpoints in browser I get the error.

Failed to load resource: the server responded with a status of 401 (Unauthorized) - https://api.soundcloud.com/favicon.ico

还有其他人遇到过这个问题吗?

Anyone else run into this issue before?

推荐答案

使用你的两个例子,我得到了两个有效的结果

Using your two examples I get valid results for both

示例 1:

https://api.soundcloud.com/resolve?url=https://soundcloud.com/calyxteebee/nothing-left&client_id=CLIENT_ID

返回

https://api.soundcloud.com/tracks/251164884?client_id=CLIENT_ID

示例 2:

https://api.soundcloud.com/resolve?url=https://soundcloud.com/mtarecords/my-nu-leng-flava-d-soul-shake&client_id=CLIENT_ID

退货

https://api.soundcloud.com/tracks/249638630?client_id=CLIENT_ID

这篇关于Soundcloud API 在某些轨道上返回 403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆