views:

284

answers:

1

The following query will return results, but some of them will contain a limitedSyndication restriction. This cannot be filtered out by format or by restriction parameters.

http://gdata.youtube.com/feeds/api/videos?alt=json-in-script&callback=jQuery.youtube.response&q=Madonna&v=2&format=5&start-index=11&max-results=10

restriction parameter is not used in the query above because YouTube Data API reference guide states the following:

By default, the API filters out videos that cannot be played in the country from which you send API requests.

Am I doing something wrong? (Besides searching for Madonna)

How can I get rid of limitedSyndication results, or is this a bug?

A: 

As stated in the GData docs, you can pass a "restriction" param that will filter out results that can't be played by the ip you pass, so you just need to get the user's IP and pass that to the request:

To request videos playable from a specific computer, include the restriction parameter in your request and set the parameter value to the IP address of the computer where the videos will be played – e.g. restriction=255.255.255.255. To request videos that are playable in a specific country, include the restriction parameter in your request and set the parameter value to the ISO 3166 two-letter country code of the country where the videos will be played – e.g. restriction=DE. You should include this parameter in any request to retrieve a list of videos, including search results, playlists, favorite videos, video responses and so forth. If a video in the API response is not playable in the location that you're using to restrict availability of the content, the <entry> for that tag will not contain a <media:content> tag. However, it will contain a <yt:state> tag that indicates that the video is restricted.
Geoff
bah, I see that you are leaving out the restriction call, and notice that you must be using javascript to make the request... so i'm not sure, seems like it should work.Did you try the restriction param?
Geoff
The documentation states: By default, the API filters out videos that cannot be played in the country from which you send API requests.So, the restriction is already being applied, because the feed request machine and playback machines are the same.I am wondering if there is a way to eliminate the videos that are only restricted for playback on youtube sites. `limitedSyndication,` I believe, are videos that are only allowed to be played on the YouTube site; the ones that say "embedding disabled by request."
Yuri