gpt4 book ai didi

json - 如何使用 iTunes 搜索流派

转载 作者:行者123 更新时间:2023-12-01 23:11:56 28 4
gpt4 key购买 nike

(我做了一个主要的编辑,因为 C# 代码片段没有帮助但掩盖了这个问题 - 希望现在更清楚了)

我正在尝试从 iTunes 中按流派获取播客列表,并尽可能使用 https://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html 中描述的 API。

我在搜索名称和解析/使用 JSON 中的响应(例如搜索)方面没有任何困难

    https://itunes.apple.com/search?term=Design&media=podcast&entity=podcast&limit=1


    {
"resultCount":1,
"results": [{"wrapperType":"track", "kind":"podcast", "artistId":127446766,"collectionId":73330703, "trackId":73330703, "artistName":"Frances Anderton", "collectionName":"KCRW's DnA: Design & Architecture", "trackName":"KCRW's DnA: Design & Architecture", "collectionCensoredName":"KCRW's DnA: Design & Architecture", "trackCensoredName":"KCRW's DnA: Design & Architecture", "artistViewUrl":"https://itunes.apple.com/us/artist/kcrw/id127446766?mt=2&uo=4", "collectionViewUrl":"https://itunes.apple.com/us/podcast/kcrws-dna-design-architecture/id73330703?mt=2&uo=4", "feedUrl":"http://feeds.kcrw.com/kcrw/de", "trackViewUrl":"https://itunes.apple.com/us/podcast/kcrws-dna-design-architecture/id73330703?mt=2&uo=4", "artworkUrl30":"http://a2.mzstatic.com/us/r30/Podcasts/v4/42/ef/6a/42ef6a04-7873-e82d-716d-ae3f1c6ebca8/mza_1492532737245560899.30x30-50.jpg", "artworkUrl60":"http://a4.mzstatic.com/us/r30/Podcasts/v4/42/ef/6a/42ef6a04-7873-e82d-716d-ae3f1c6ebca8/mza_1492532737245560899.60x60-50.jpg", "artworkUrl100":"http://a2.mzstatic.com/us/r30/Podcasts/v4/42/ef/6a/42ef6a04-7873-e82d-716d-ae3f1c6ebca8/mza_1492532737245560899.100x100-75.jpg", "collectionPrice":0.00, "trackPrice":0.00, "trackRentalPrice":0, "collectionHdPrice":0, "trackHdPrice":0, "trackHdRentalPrice":0, "releaseDate":"2014-12-30T08:00:00Z", "collectionExplicitness":"notExplicit", "trackExplicitness":"notExplicit", "trackCount":25, "country":"USA", "currency":"USD", "primaryGenreName":"Design", "radioStationUrl":"https://itunes.apple.com/station/idra.73330703", "artworkUrl600":"http://a3.mzstatic.com/us/r30/Podcasts/v4/42/ef/6a/42ef6a04-7873-e82d-716d-ae3f1c6ebca8/mza_1492532737245560899.600x600-75.jpg", "genreIds":["1402", "26", "1301"], "genres":["Design", "Podcasts", "Arts"]}]
}

但是当试图根据流派获取播客列表时,例如当使用流派 ID“1402”尝试从流派“设计”中获取列表时(实际上,我使用的任何 ID 号都会发生)使用以下命令
    https://itunes.apple.com/search?term=1402&media=podcast&entity=podcast&attribute=genreIndex&limit=1

我得到的是这个
{
"resultCount":0,
"results": []
}

(我从这里获取 http://www.apple.com/itunes/affiliates/resources/documentation/genre-mapping.html 的 id)

显然我在这里做了一些小错误.. :(.. API 描述中是否缺少某些内容?

最佳答案

为什么不像这样使用genreId?这是我偶然发现的一个未记录的搜索参数。

https://itunes.apple.com/search?term=podcast&genreId=1402&limit=200

关于json - 如何使用 iTunes 搜索流派,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27760167/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com