Soundcloud API 在某些轨道上返回 403

编程入门 行业动态 更新时间:2024-10-22 10:52:44
本文介绍了Soundcloud API 在某些轨道上返回 403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

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/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/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/mtarecords/my-nu-leng-flava-d-soul-shake') 

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

https://soundcloud/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/favicon.ico

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

Anyone else run into this issue before?

推荐答案

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

Using your two examples I get valid results for both

示例 1:

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

返回

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

示例 2:

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

退货

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

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

更多推荐

[db:关键词]

本文发布于:2023-04-18 15:17:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/942718.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:轨道   在某些   Soundcloud   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!