【问题标题】:MIssing property in response from SoundCloud API响应 SoundCloud API 的缺失属性
【发布时间】:2014-10-15 23:31:45
【问题描述】:

我在检索一些关于其中一些曲目的数据时遇到了麻烦。

我使用端点 /tracks 和一个 GET HTTP 请求来进行查询。以这条赛道为例:

id = 76255568

这是我收到的 JSON:

{
"artwork_url" = "https://i1.sndcdn.com/artworks-000039059040-szzrcm-large.jpg";
"attachments_uri" = "https://api.soundcloud.com/tracks/76255568/attachments";
bpm = "<null>";
commentable = 1;
"created_at" = "2013/01/24 12:14:16 +0000";
description = "Bonobo\U2019s Live Album \U2018The North Borders Tour - Live\U2019 is released on 6 Oct 2014. Available on CD + DVD with 70-page hardback book, or ltd vinyl and audio download.\n\nORDER NOW\nBonobo Store: http://bonobomusic.com/shop\nAmazon: smarturl.it/northborderslivecd\niTunes: smarturl.it/northbordersliveit\n\nPREVIEW\nDVD Trailer: youtu.be/onCHyksRWiE\nMore Info: bonobomusic.com/news/live";
downloadable = 0;
duration = 352371;
"embeddable_by" = all;
genre = Electronic;
id = 76255568;
isrc = "";
"key_signature" = "";
kind = track;
label =     {
    "avatar_url" = "https://i1.sndcdn.com/avatars-000099073699-09bigf-large.jpg";
    id = 95982;
    kind = user;
    "last_modified" = "2014/10/15 13:58:34 +0000";
    permalink = "ninja-tune";
    "permalink_url" = "http://soundcloud.com/ninja-tune";
    uri = "https://api.soundcloud.com/users/95982";
    username = "Ninja Tune";
};
"label_id" = 95982;
"label_name" = "Ninja Tune";
"last_modified" = "2014/10/15 16:14:00 +0000";
license = "all-rights-reserved";
"original_content_size" = 15437251;
"original_format" = mp3;
permalink = cirrus;
"permalink_url" = "http://soundcloud.com/bonobo/cirrus";
policy = ALLOW;
"purchase_title" = "<null>";
"purchase_url" = "http://bonobomusic.com/shop";
release = "";
"release_day" = "<null>";
"release_month" = "<null>";
"release_year" = "<null>";
sharing = public;
state = finished;
"stream_url" = "https://api.soundcloud.com/tracks/76255568/stream";
streamable = 1;
"tag_list" = "bonobo cirrus north borders ninja tune electronic house instrumental cyriak";
title = Cirrus;
"track_type" = original;
uri = "https://api.soundcloud.com/tracks/76255568";
user =     {
    "avatar_url" = "https://i1.sndcdn.com/avatars-000101336939-rzj1kf-large.jpg";
    id = 8962073;
    kind = user;
    "last_modified" = "2014/10/15 13:57:43 +0000";
    permalink = bonobo;
    "permalink_url" = "http://soundcloud.com/bonobo";
    uri = "https://api.soundcloud.com/users/8962073";
    username = bonobo;
};
"user_id" = 8962073;
"video_url" = "http://www.youtube.com/watch?v=WF34N4gJAKE&feature=youtu.be";
"waveform_url" = "https://w1.sndcdn.com/vR5ukuOzyLbw_m.png";
}

属性playback_count 丢失。可能是其他一些,但我想使用这个。 当我使用 Souncloud 的 iOS 应用程序时,会显示计数。

你知道如何找回它吗?有可能吗?

谢谢

【问题讨论】:

    标签: ios json api soundcloud


    【解决方案1】:

    SoundCloud 具有一个Quiet Mode,使用户能够显示或隐藏统计数据。

    如果托管轨道的帐户切换到安静模式或直接联系帐户持有人,则可以检索playback_count

    【讨论】:

      【解决方案2】:

      在最新版本的 SoundCloud API 中,此曲目返回 playback_count

      HTTP GET: https://api.soundcloud.com/tracks/107686148&client_id={CLIENT_ID}
      

      回复:

      {
        "kind": "track",
        "id": 76255568,
        "created_at": "2013/01/24 12:14:16 +0000",
        "user_id": 8962073,
        "duration": 352346,
        "commentable": true,
        "state": "finished",
        "original_content_size": 39680549,
        "last_modified": "2018/08/08 23:49:24 +0000",
        "sharing": "public",
        "tag_list": "",
        "permalink": "cirrus",
        "streamable": true,
        "embeddable_by": "all",
        "purchase_url": "http://bonobomusic.com/shop",
        "purchase_title": null,
        "label_id": 95982,
        "genre": "Electronic",
        "title": "Cirrus",
        "description": "Bonobo’s Live Album ‘The North Borders Tour - Live’ is available on CD + DVD with 70-page hardback book, or ltd vinyl and audio download.\n\nORDER NOW\nBonobo Store: http://bonobomusic.com/shop\nAmazon: smarturl.it/northborderslivecd\niTunes: smarturl.it/northbordersliveit\n\nPREVIEW\nDVD Trailer: youtu.be/onCHyksRWiE\nMore Info: bonobomusic.com/news/live",
        "label_name": "Ninja Tune",
        "release": "",
        "track_type": "original",
        "key_signature": "",
        "isrc": "GBCFB1300100",
        "video_url": "http://www.youtube.com/watch?v=WF34N4gJAKE&feature=youtu.be",
        "bpm": null,
        "release_year": 2013,
        "release_month": 1,
        "release_day": 21,
        "original_format": "flac",
        "license": "all-rights-reserved",
        "uri": "https://api.soundcloud.com/tracks/76255568",
        "user": {
          "id": 8962073,
          "kind": "user",
          "permalink": "bonobo",
          "username": "bonobo",
          "last_modified": "2018/04/03 11:36:24 +0000",
          "uri": "https://api.soundcloud.com/users/8962073",
          "permalink_url": "http://soundcloud.com/bonobo",
          "avatar_url": "https://i1.sndcdn.com/avatars-000316888849-d2fwcv-large.jpg"
        },
        "permalink_url": "https://soundcloud.com/bonobo/cirrus",
        "artwork_url": "https://i1.sndcdn.com/artworks-zDHju4alpJDk-0-large.jpg",
        "stream_url": "https://api.soundcloud.com/tracks/76255568/stream",
        "download_url": "https://api.soundcloud.com/tracks/76255568/download",
        "playback_count": 3214194,
        "download_count": 0,
        "favoritings_count": 55066,
        "reposts_count": 10580,
        "comment_count": 1296,
        "label": {
          "id": 95982,
          "kind": "user",
          "permalink": "ninja-tune",
          "username": "Ninja Tune",
          "last_modified": "2018/08/30 14:06:40 +0000",
          "uri": "https://api.soundcloud.com/users/95982",
          "permalink_url": "http://soundcloud.com/ninja-tune",
          "avatar_url": "https://i1.sndcdn.com/avatars-000099073699-09bigf-large.jpg"
        },
        "downloadable": false,
        "waveform_url": "https://w1.sndcdn.com/RjEiZYx8JsA7_m.png",
        "attachments_uri": "https://api.soundcloud.com/tracks/76255568/attachments"
      }
      

      尝试使用 HTTP REST API 而不是 iOS SDK。

      【讨论】:

        猜你喜欢
        • 2015-03-21
        • 2017-11-29
        • 1970-01-01
        • 1970-01-01
        • 2018-04-06
        • 2018-05-12
        • 2018-08-24
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多