iTunes RSS Feed始终返回持续时间= 30000

时间:2016-11-02 10:22:17

标签: ios rss itunes

我使用以下link来获取iTunes for USA的前10首歌曲:

https://itunes.apple.com/us/rss/topsongs/limit=10/explicit=true/json

我需要每首歌的持续时间,但我总是会在 30000 中获得持续时间的价值:

"im:duration": {
"label": "30000"
}

这是什么意思,是否有办法获得正确的持续时间值?感谢。

1 个答案:

答案 0 :(得分:1)

我使用了这个online time calculator,所有歌曲的持续时间总和为37.97分钟;检查歌曲样本在火上设置世界(使用P!nk)

我认为30000只是示例持续时间的值。您提供的RSS链接不包含歌曲的持续时间,如ITunes网站所示

如果你真的需要歌曲的真实持续时间,你必须使用另一种获取此信息的方式。

我尝试使用“The Widget Builder”并选择“ITunes Search”。

此处,当您使用小部件搜索歌曲时(例如:输入 dile ),如果您在“网络”标签中进行调试,您将获得以下网址:

https://itunes.apple.com/search?limit=20&country=us&media=music&entity=song&term=dile&callback=jQuery183020996109495104198_1478097762593&_=1478097910165

结果是:

{
    "wrapperType": "track",
    "kind": "song",
    "artistId": 65630139,
    "collectionId": 76542569,
    "trackId": 76542586,
    "artistName": "Don Omar",
    "collectionName": "The Last Don",
    "trackName": "Dile",
    "collectionCensoredName": "The Last Don",
    "trackCensoredName": "Dile",
    "artistViewUrl": "https://itunes.apple.com/us/artist/don-omar/id65630139?uo=4",
    "collectionViewUrl": "https://itunes.apple.com/us/album/dile/id76542569?i=76542586&uo=4",
    "trackViewUrl": "https://itunes.apple.com/us/album/dile/id76542569?i=76542586&uo=4",
    "previewUrl": "http://a1801.phobos.apple.com/us/r1000/136/Music7/v4/49/06/fe/4906fee2-16c0-9e99-64e9-e2d39c58b2b5/mzaf_6968581882856624700.plus.aac.p.m4a",
    "artworkUrl30": "http://is4.mzstatic.com/image/thumb/Music5/v4/d3/b3/6c/d3b36c67-3b50-f55e-df74-9febe37c80f9/source/30x30bb.jpg",
    "artworkUrl60": "http://is4.mzstatic.com/image/thumb/Music5/v4/d3/b3/6c/d3b36c67-3b50-f55e-df74-9febe37c80f9/source/60x60bb.jpg",
    "artworkUrl100": "http://is4.mzstatic.com/image/thumb/Music5/v4/d3/b3/6c/d3b36c67-3b50-f55e-df74-9febe37c80f9/source/100x100bb.jpg",
    "collectionPrice": 9.99,
    "trackPrice": 1.29,
    "releaseDate": "2003-06-17T07:00:00Z",
    "collectionExplicitness": "notExplicit",
    "trackExplicitness": "notExplicit",
    "discCount": 1,
    "discNumber": 1,
    "trackCount": 15,
    "trackNumber": 4,
    "trackTimeMillis": 204600,
    "country": "USA",
    "currency": "USD",
    "primaryGenreName": "Latin Urban",
    "isStreamable": true
}

在那里,您获得trackTimeMillis属性。

希望它有所帮助。