soundcloud API - JSON轨道计数与配置文件跟踪计数不匹配 [英] soundcloud API - JSON track count does not match profile track count

查看:109
本文介绍了soundcloud API - JSON轨道计数与配置文件跟踪计数不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用soundcloud JavaScript SDK构建一个Web应用程序,它只返回包含一个或多个轨道的配置文件。

I'm building a web app using the soundcloud JavaScript SDK that should only return profiles that contain one or more tracks.

我的GET请求返回一个用户数组配置文件,每个包括track_count属性和相关值,如预期的那样。

My GET request returns an array of user profiles, each including the track_count property and associated value, as expected.

然而,当我按照每个配置文件的链接时,轨道数通常与值不同列在JSON中(参见下图中的示例)。至关重要的是,就我的目的而言,这意味着它有时会返回包含0个曲目的个人资料。

However, when I follow the link to each profile, the number of tracks is often different from the value listed in the JSON (see example in images below). Crucially, in relation to my purpose, this means that it sometimes returns profiles with 0 tracks.

从我的测试到目前为止,我发现如果值不同那么配置文件跟踪计数总是小于JSON。这是否意味着它包括已被删除或删除的曲目(例如因侵犯版权而被侵权)?

From my tests so far, I've found that if the values are different then the profile track count is always less than in the JSON. Could this mean that's it's including tracks that have been deleted or removed (e.g. because of copyright infringement)?

如果有人能够对此有所了解,我将非常感激。

I would really appreciate if someone could shed some light on this.

谢谢!

$(document).ready(function() {
          SC.initialize({
            client_id: 'xxxx',
            redirect_uri: 'http://localhost/callback.html'
          });

          SC.get('/users/12490371/followers', {

            limit: page_size,
            linked_partitioning: 1

          }).then(function(followers) {

            $(followers.collection).each(function(i) {
              //console.log(followers.collection[i].track_count)

              if (followers.collection[i].track_count > 10 && followers.collection[i].followers_count < 500) {
                $("#list").append(
                  "<ul>" +
                  "<li class='username'>" + this.username + "</li>" +
                  "<li>" + this.followers_count + "</li>" +
                  "<li>" + this.track_count + "</li>" +
                  "<li><a href='" + this.permalink_url + "' target='_blank'>GO</a>" + "</li>" +
                  "</ul>"
                );
              }

            });
          });
        });

<div id="list">
  <ul>
    <li class='username'>Username</li>
    <li>Followers</li>
    <li>Track count</li>
    <li>Profile</li>
  </ul>
</div>

个人资料视图
JSON视图

推荐答案

要回答你的问题,肯定看来 SoundCloud API返回艺术家的所有曲目,无论这些曲目处于何种状态(公共,私人等)。

To answer your question, it definitely seems that the SoundCloud API returns all tracks from the artist, no matter what state those tracks are in (public, private, etc.).

就其他方面而言,Sound Cloud因严格控制艺术家的内容在嵌入或在其他网站上使用的方式而臭名昭着。根据我的理解,这通常取决于艺术家,但一般来说,他们希望艺术家的内容受到保护,特别是如果他们与唱片公司或其他东西签订合同。

As far as the rest goes, Sound Cloud is notorious for being strict with how artists' content is handled in terms of embedding or having it used on other sites. It is usually up to the artist from my understanding, but in general, they want artists' content to be protected, especially if they are under a contract with a record company or something.

至于你的网络应用程序,你要么必须解决它,要么完全抛弃它,除非你可以创建一些可以获得更多相关信息的刮刀。但是,如果您的网站想直接从网站播放音乐,那么您可能会感到茫然。

As for your web app, you'll either have to work around it or just ditch it completely, unless you can create some sort of scraper that can get more relevant info. If your site wants to play music directly from the site, however, you may be at a loss.

这篇关于soundcloud API - JSON轨道计数与配置文件跟踪计数不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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