的SoundCloud API是在一些轨道返回403 [英] Soundcloud API is returning 403 on some tracks

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

问题描述

Soundclouds API是在一些曲目给我回403。我曾尝试与原始的HTTP端点,也为蟒蛇的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

而低于一期工程,采用相同的CLIENT_ID显然上述其中一个返回403错误

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.

如果你去分享 - >嵌入的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:

<一个href=\"https://api.soundcloud.com/resolve?url=https://soundcloud.com/calyxteebee/nothing-left&client_id=CLIENT_ID\" rel=\"nofollow\">https://api.soundcloud.com/resolve?url=https://soundcloud.com/calyxteebee/nothing-left&client_id=CLIENT_ID

返回

returns

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

例2:

<一个href=\"https://api.soundcloud.com/resolve?url=https://soundcloud.com/mtarecords/my-nu-leng-flava-d-soul-shake&client_id=CLIENT_ID\" rel=\"nofollow\">https://api.soundcloud.com/resolve?url=https://soundcloud.com/mtarecords/my-nu-leng-flava-d-soul-shake&client_id=CLIENT_ID

返回

returns

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

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

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