YouTube的API - 比在youtube.com上搜索结果更糟 [英] Youtube API - worse results than by searching on youtube.com

查看:111
本文介绍了YouTube的API - 比在youtube.com上搜索结果更糟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立last.fm + YouTube的混搭,我有麻烦了来自YouTube的搜索检索右击结果。

I am building last.fm+youtube mashup and I am having trouble retrieving righ results from youtube search.

例如。
<一href=\"http://gdata.youtube.com/feeds/api/videos?q=Gedz+Gucci%20Gucci%20(feat.%20Joda)&orderBy=relevance\">http://gdata.youtube.com/feeds/api/videos?q=Gedz+Gucci%20Gucci%20(feat.%20Joda)&orderBy=relevance

<一个href=\"http://www.youtube.com/results?search_query=Gedz+Gucci%20Gucci%20(feat.%20Joda)&oq=Gedz+Gucci%20Gucci%20(feat.%20Joda\">http://www.youtube.com/results?search_query=Gedz+Gucci%20Gucci%20(feat.%20Joda)&oq=Gedz+Gucci%20Gucci%20(feat.%20Joda)

我感兴趣的赛道在youtube.com搜索第二位。我怎样才能让API结果尽可能多的类似youtube.com搜索?

The track I am interested in is on the second place in youtube.com search. How I can make api results look as much similar to youtube.com search?

推荐答案

该方法的YouTube 使用了它提供的主页上的搜索结果包括 相关视频这是基于专有算法。

The method YouTube uses for it's provided search results on the home page includes Related Videos which is based on a proprietary algorithm.

不幸的是的,这种专有方法还不是他们的API(V1或电流V2)这就是为什么你不会有相同的结果提供了做用。

Unfortunately, this proprietary method is not yet available in their API (v1 or current v2) which is why you don't have the same results provided.

通过YouTube API页面展示了如何使用Related影片 API功能,但只针对单一的视频,因为它限制使用。

The YouTube API Page shows how to use the Related Videos API feature, but only for a single video since it's limited to that use.

我见过的各种问题/来来去去对这个问题的论坛,像这样的<一个回复href=\"https://developers.google.com/youtube/forum/discussion?place=topic%2Fyoutube-api-gdata%2F4A7Ook3dG0Q%2Fdiscussion\">ignored之一。

I've seen various questions/replies that come and go on the forum about this issue, like this ignored one.



考虑使用相关影片一个基于单个视频,它的API不支持。


Consider using the Related Videos based on a single video, which the API does support.

这是使用YouTube的视频 Gedz的例子 - 古驰Guccigość。乔达 是:

Example of that usage for YouTube Video Gedz - Gucci Gucci gość. Joda is:

<一个href=\"https://gdata.youtube.com/feeds/api/videos/oepPdNKzxk0/related?v=2\">https://gdata.youtube.com/feeds/api/videos/oepPdNKzxk0/related?v=2

您将看到的 25结果相似但不准确的单个视频的YouTube页面(默认情况下,查询未指定数量时)。不同的算法的在作怪这里也一样,但这种方法是最好的,是目前已经上市。

You will see 25 results (default quantity when not specified in query) that are similar but not exact as the single video's YouTube page. Different algorithm's are at play here too, but this method is the best that's currently available.



我对你的项目目标,未经考验的解决方法如下:

1 使用当前的方法来获取视频ID饲料。

2 如果结果小于所需的量,使用返回结果的第一个视频ID作为参考。

3。视频ID引用(只是一个单一的视频),然后用于为相关视频执行另一个查询。
4。您可以再结合两个查询的创建最后名单 视频ID的用哪个。


My untested solution for your project goal is as follows:
1. Use current method to acquire video ID feeds.
2. If the results are less than the amount required, use the returned results first Video ID as a reference.
3. The Video ID reference (just a single video) is then used to perform another query for Related Videos. 4. You can then combine both query's to create a final list of Video ID's which to use.

这篇关于YouTube的API - 比在youtube.com上搜索结果更糟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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