检索 YouTube Disco 播放列表 [英] Retrieving a YouTube Disco playlist

查看:34
本文介绍了检索 YouTube Disco 播放列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

YouTube 有这个很酷的东西,可以根据一些起始关键字创建智能播放列表".我想以编程方式访问播放列表.我找到了 YouTube 数据 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.

以下答案之一建议使用

http://www.youtube.com/disco?action_search=1&query=XXXXXXXXX

这将返回一些 JSON,其中包含要播放的第一个视频和一个 list 属性.不幸的是,list 是一个 32 个字符的十六进制字符串,而普通的播放列表 ID 是一个 16 个字符的十六进制字符串.这意味着用于检索完整播放列表的标准数据 API 不起作用.

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.

有什么建议吗?

推荐答案

首先,我必须说我从未使用过 youtube data API,所以我不知道下面的信息会有多大用处.

First, I must say I I never used youtube data API, so I don't know how useful below information will be.

举个例子:

我想制作 Smashing Pumpkins.我输入了艺术家的名字,然后点击了Disco!"按钮.使用 Fiddler2 我发现请求的网址是:

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:

www.youtube.com/disco?action_search=1&query=smashing%20pumpkins

注意,空格被替换为 %20.作为响应,我得到了简单的 JSON 响应:

Notice, that spaces are replaced with %20. As a response i got simple JSON response:

{"url": "\/watch?v=bhMz7x1ZaGM\u0026feature=disco\u0026playnext=1\u0026list=MLGxdCwVVULXe5-F4X_zm6wnblRsnXoPJS"}

这是新生成的Smashing Pumpkins播放列表第一首歌曲的链接,地址为list=MLGxdCwVVULXe5-F4X_zm6wnblRsnXoPJS.您所要做的就是将 \u0026 替换为 & 并获得一个有效链接.

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.

我认为您可以通过官方 youtube 数据 API 获得您想做的其他魔法.希望我的研究能帮到你.

I assume the rest magic you want to do is available via official youtube data API. I hope my research will help you.

编辑

嗯,看起来这个由 youtube/disco 生成的播放列表与用户可以生成的播放列表类型不同,并且可以通过 API 获得.列表 ID 比平时长,当您单击有关播放列表的更多信息"时,您将被重定向到艺术家个人资料.基于这两个事实,我想通过 API 检索生成的列表是不可能的.对不起.

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.

这篇关于检索 YouTube Disco 播放列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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