问题描述
我看转向一个iTunes播客ID成播客制作者提供RSS提要的方式。
我知道的时,它可以被用来生成的链接的播客的进料,但这些链接是HTML页面。
如果你有iTunes中打开,您可以手动导出为OPML导出播客列表,所以我们可以推测,最终的iTunes知道如何去code他们(即它们不是完全通过ITMS主机会)。
我已经看了看它给你一些不错的JSON回来。这给你一个 collectionViewUrl
这是一样的,在RSS生成给出的那些,和顺便说一句,iTunes链路发生器的。它也给你 ID
,和其他的东西整个负载,包括未在火卫一主持的preVIEW音频文件。
在这一点上,我正在寻找任何会帮我解决这个问题,包括任何语言,非正式的或没有。
(事实上,我preFER东西隐约的支持,并在Java中,不涉及HTML刮)。
通过从these 的问题,我已经找到了一种方法做我想做的。
找到播客示例
第一:抓住从iTunes播客列表,使用RSS生成。我不知道的查询参数是如何工作的呢,但这里是美国顶级技术播客的RSS feed。
<$p$p><$c$c>http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/toppodcasts/sf=143441/limit=25/genre=1318/xml-
SF
涉及到了国家,并且是可选的。我猜想,这个默认为全局如果缺席。 -
类型
涉及体裁,并且是可选的。我猜想,这个默认为所有类型是不存在的。 -
限制
是可选的,似乎默认为9。
这让你播客的Atom提要。你需要做一些sperlunking使用XPath去播客的ITMS ID,但你正在寻找载于以下XPath找到该URL的数字ID:
/原子:饲料/原子:进入/原子:链接[@相对='alernate'] / @ HREF
例如,优JavaPosse有81157308的ID。
的问题的答案
一旦你的身份证,你可以得到另一个文件,它会告诉你,最后一集,和原来的资讯提供网址。这里的缺点是,你需要使用一个iTunes用户代理来得到这个文件。
例如。
wget的--user代理的iTunes / 7.4.1 \\
--no检查证书\\
\"https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/com.apple.jingle.app.finance.DirectAction/subscribePodcast?id=81157308&wasWarnedAboutPodcasts=true\"
这是一个包含有关播客的一些元数据,包括供稿网址的plist。
<$p$p><$c$c><key>feedURL</key><string>http://feeds.feedburner.com/javaposse</string>本中的XPath可能是这样的:
//键[@文本='feedURL'] /以下同胞::字符串/文本()
免责声明
不完全知道如何稳定任何这是,或者如何法律这是。情况因人而异。
I'm look at a way of turning an iTunes podcast id into the RSS feed that the podcast producer serves.
I'm aware of the RSS generator, which can be used to generate a feed of links to podcasts, but these links are to HTML pages.
If you have iTunes open, you can manually export the list of podcasts by exporting to OPML, so we can surmise that iTunes eventually knows how to decode them (i.e. they're not exclusively going through an iTMS host).
I have looked at the Affiliate API document which gives you some nice JSON back. This gives you a collectionViewUrl
which is the same as the ones given in the RSS generator, and incidentally, the iTunes Link Generator. It also give you the id
, and a whole load of other things including a preview audio file which is not hosted on the phobos.
At this point, I'm looking for anything that would help me solve this question, including any language, unofficial or not.
(in actual fact, I'd prefer something vaguely supported, and in Java, that didn't involve HTML scraping).
Through a combination of answers from these two questions, I have found a way to do what I want.
Example of finding podcasts
First: grab a list of podcasts from iTunes, using the RSS generator. I'm not sure how the query parameters work yet, but here is an RSS feed for top tech podcasts in the US.
http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/toppodcasts/sf=143441/limit=25/genre=1318/xml
sf
relates to country, and is optional. I would guess that this defaults to global if absent.genre
relates to genre, and is optional. I would guess that this defaults to "all genres" is absent.limit
is optional, and seems to default to 9.
This gives you an Atom feed of podcasts. You'll need to do some sperlunking with XPath to get to the ITMS id of podcast, but you're looking for the numeric id contained in the URL found at the following XPath:
/atom:feed/atom:entry/atom:link[@rel='alernate']/@href
For example, the excellent JavaPosse has an id of 81157308.
The Answer to the Question
Once you have that id, you can get another document which will tell you the last episode, and the original feed URL. The catch here is that you need to use an iTunes user-agent to get this document.
e.g.
wget --user-agent iTunes/7.4.1 \
--no-check-certificate \
"https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/com.apple.jingle.app.finance.DirectAction/subscribePodcast?id=81157308&wasWarnedAboutPodcasts=true"
This is a plist containing some metadata about the podcast, including the feed URL.
<key>feedURL</key><string>http://feeds.feedburner.com/javaposse</string>
The XPath for this could be something like:
//key[@text='feedURL']/following-sibling::string/text()
Disclaimer
Not entirely sure how stable any of this is, or how legal it is. YMMV.
这篇关于查找网址播客从iTunes编号饲料。 (ITMS API)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!