如何使用iTunes搜索类型 [英] How to use iTunes search for genres

查看:144
本文介绍了如何使用iTunes搜索类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(我进行了重大修改,因为C#代码段无济于事,但掩盖了这个问题-希望现在可以更清楚了)

(I made a major edit as the C# code snippets were not helping but masked the issue - hopefully it is clearer now)

我试图按照我毫不费力地搜索名称并解析/使用JSON中的响应,例如搜索

I have no difficulties in searcing for a name and parsing / using the response in JSON e.g.the search

    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号),使用以下

But when trying to get a list of podcasts based on genre, e.g. when using genre id "1402" for trying to get list from the genre "Design" (happens with whatever id number I use, actually) using the following

    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 )

很明显,我在这里犯了一些小错误.:( .. API描述中缺少某些内容吗?

Obviously I am doing something trivial wrong here.. :(.. Is there something missing from the API description?

推荐答案

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

Why not use genreId like so? It's an undocumented search parameter that I stumbled on by accident.

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

这篇关于如何使用iTunes搜索类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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