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

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

问题描述

我正在构建 last.fm+youtube mashup,但无法从 youtube 搜索中检索正确的结果.

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

例如http://gdata.youtube.com/feeds/api/videos?q=Gedz+Gucci%20Gucci%20(feat.%20Joda)&orderBy=relevance

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 页面展示了如何使用相关视频 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.

我在论坛上看到过关于此问题的各种问题/回复,例如忽略一个.

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


考虑使用基于 API 支持的单个视频相关视频.

YouTube 视频的这种用法示例Gedz - Gucci Gucci gość.乔达是:

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

https://gdata.youtube.com/feeds/api/视频/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天全站免登陆