views:

509

answers:

2

Over at SpokenWord.org we’re trying to figure out how to scrape YouTube pages (or pages with embedded YouTube players), then hack a video or ShockWave URL that we can include in the <enclosure> element of RSS feeds. We’ve been able to do this for programs in YouTube EDU such as this page, which we convert to this media-file URL. The latter URL can be played by standard Flash players, so we can include it in RSS feeds. But this only works for certain special cases such as YouTube EDU, not for mainstream YouTube pages. We don't want to convert the YouTube files to video, etc. We don't have rights/permission to do so.

A: 

Would it not be easier to simply find the related video on youtube itself via the youtube API?

Soviut
I'll have to study the API again to see if it offers a way to do this. Last I looked (admittedly a while ago) I didn't see it there.
Doug Kaye
+1  A: 

Every video has its own data feed, you just need the video id and you can grab the info, including the url to the embeddable version (assuming it's able to be embedded).

Here's what the urls would look like for each:

http://gdata.youtube.com/feeds/api/videos/VIDEO_ID

There may be an easier way to use the gdata api to get what you want, perhaps if you elaborated on what you are trying to do?

Like where is the original source of the videos coming from - are you doing searches, or are you looking for specific youtube users? The api should be able to accommodate any of those scenarios.

Geoff
Doug Kaye
The advantage of using the GData feed is it will tell you if there are any restrictions on the content, such as being non-embeddable off of youtube.com, or if there are any country restrictions. This is less used by general users, but can be useful in some situations.
Geoff