【问题标题】:Soundcloud API 401 error when resolving song/user url解析歌曲/用户 url 时出现 Soundcloud API 401 错误
【发布时间】:2013-03-13 20:47:13
【问题描述】:

每当我尝试解析 url 以获取歌曲的 id 时,它都会返回 401 错误。我的客户端适用于其他操作(GET:/me,POST:/me/followings/[id])。这是我在 soundcloud gem 中使用的代码:

client.get('/resolve', url: "http://soundcloud.com/stuart-mckeown/darius-bassiray-consortium-of")

【问题讨论】:

  • 使用 api 控制台,这将返回 302(这是预期的行为)。也许这是宝石的错误?网址:api.soundcloud.com/…
  • 您知道要获取的曲目的 id 还是 URL?
  • 不应该是https 而不是http吗?
  • 可能是另一个问题,因为这对我有用我回来了 Soundcloud::HashResponseWrapper artifact_url=nil attachments_uri="api.soundcloud.com/tracks/61784549/attachments" bpm=nil comment_count=0 commentable=true created_at="2012/10/ 01 06:01:18 +0000" description="没有进入最终版本的混音,享受吧!"...

标签: ruby soundcloud


【解决方案1】:

我花了一点时间才弄明白,但是您还需要发送客户端 ID:

client.get('/resolve', :url => url, :client_id => ENV['SOUNDCLOUD_ID'])

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-05
    • 2022-12-05
    • 2012-05-12
    相关资源
    最近更新 更多