检索 YouTube Disco 播放列表
YouTube 有这个很酷的东西,可以根据一些起始关键字创建“智能播放列表”。我想以编程方式访问播放列表。我找到了 YouTube 数据 API,但它没有讨论“迪斯科”功能。
下面的答案之一建议使用
http://www.youtube.com/disco?action_search=1&query=XXXXXXXXX
,
它将返回一些 JSON 以及要播放的第一个视频,以及 list
属性。不幸的是,列表是 32 个字符的十六进制字符串,而正常的播放列表 ID 是 16 个字符的十六进制字符串。这意味着用于检索完整播放列表的标准数据 API 不起作用。
有什么建议吗?
YouTube has this cool thing that creates a "smart playlist" from some starting keywords. I would like to programmatically access the playlist. I've found the YouTube data API but it doesn't discuss the "disco" feature.
One of the answers below suggests using
http://www.youtube.com/disco?action_search=1&query=XXXXXXXXX
that will return some JSON with the first video to be played, and a list
property. Unfortunately, the list
is a 32-character hex string, whereas normal playlist ID's are 16-character hex strings. This means that the standard data API to retrieve the full playlist doesn't work.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,我必须说我从未使用过 youtube data API,所以我不知道以下信息有多大用处。
让我举个例子:
我想制作《粉碎南瓜》。我输入了艺术家的名字并点击了“Disco!”按钮。使用 Fiddler2 我发现请求的网址是:
注意,空格被替换为
%20
。作为响应,我得到了简单的 JSON 响应:这是新生成的 Smashing Pumpkins 播放列表的第一首歌曲的链接,其地址为
list=MLGxdCwVVULXe5-F4X_zm6wnblRsnXoPJS
。您只需知道将\u0026
替换为&
即可获得有效链接。我假设您想要做的其余魔法可以通过官方 YouTube 数据 API 获得。
我希望我的研究对你有帮助。
编辑
嗯,看起来 youtube/disco 生成的播放列表与用户可以生成且可通过 API 获取的播放列表类型不同。列表 ID 比平常长,当您单击“有关播放列表的更多信息”时,您将被重定向到艺术家个人资料。基于这两个事实,我猜想通过 API 检索生成的列表是不可能的。对不起。
First, I must say I I never used youtube data API, so I don't know how useful below information will be.
Let me use an example:
I wanted to create Smashing Pumpkins. I typed the artist name and clicked the "Disco!" button. Using Fiddler2 I figured out the requested url was:
Notice, that spaces are replaced with
%20
. As a response i got simple JSON response:It was a link to the first song of freshly generated Smashing Pumpkins playlist, which address was
list=MLGxdCwVVULXe5-F4X_zm6wnblRsnXoPJS
. All you have to do know is replacing\u0026
with&
and you get a valid link.I assume the rest magic you want to do is available via official youtube data API.
I hope my research will help you.
EDIT
Well, it looks like this playlist generated by youtube/disco is not the same type of playlist that users can generate and that is available via API. The list ID is longer than usuall and when you click "More info about playlist" you are redirected to artists profile. Based on this two facts, i guess it's impossible to retrive generated lists via API. Sorry.
@Randomblue,您到底想如何检索此播放列表?
您可以在此 url 中使用 32 个字符的十六进制来获取详细说明播放列表的页面
或嵌入播放列表 iframe 中,如下所示:
@Randomblue, how exactly do you want to retrieve this playlist?
You can use the 32 char hex in this url to get a page detailing the playlist
or in an embed playlist iframe, like this: