RSS/ATOM video feeds (or how to get size of youtube video)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

RSS/ATOM video feeds (or how to get size of youtube video)

Post by Eric! »

RSS and ATOM feeds block embed or object tags so things like youtube videos are blocked. Does anyone know of a fix/hack around this for video objects?
Last edited by Eric! on Mon Nov 15, 2010 7:36 am, edited 1 time in total.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: RSS/ATOM feeds with embed or object tags

Post by requinix »

RSS/Atom doesn't "block" anything but your RSS reader might.

Look into enclosures.
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: RSS/ATOM feeds with embed or object tags

Post by Eric! »

Right, I was just being brief about the blocking technique. Anyway good idea and I've looked into the envelope element you suggested, but I found there is no easy way to get the length from youtube. I was hoping to extract the Content-Length data via curl, but no luck. Streaming it and counting bytes would take way too long when generating xml feeds. Am I just SOL?

Headers in http/1.0 (not chunked):
[text]HTTP/1.0 200 OK
Date: Mon, 15 Nov 2010 12:08:24 GMT
Server: wiseguy/0.6.7
X-Content-Type-Options: nosniff
Set-Cookie: use_hitbox=72c46ff6cbcdb7c551314baddaa223b6b334edAEAAAAw; path=/; domain=.youtube.com
Set-Cookie: VISITOR_INFO1_LIVE=HF5dD95ahvE; path=/; domain=.youtube.com; expires=Wed, 13-Jul-2011 12:08:23 GMT
Set-Cookie: PREF=f1=50000000; path=/; domain=.youtube.com; expires=Thu, 12-Nov-2020 12:08:24 GMT
Set-Cookie: GEO=2025f63e12369126b8e88f071eca33e84cwsAAAAzTVi7hMjLTOEitw==; path=/; domain=.youtube.com
Set-Cookie: watched_video_id_list=7dfa3328581111f35f5cbf22b34bd542WwEAAABzCwAAAHaa532aXp5MGs5bVpR; path=/; domain=.youtube.com
Expires: Tue, 27 Apr 1971 19:44:06 EST
Cache-Control: no-cache
Content-Type: text/html; charset=utf-8[/text]

in http/1.1
[text]HTTP/1.1 200 OK
Date: Mon, 15 Nov 2010 12:11:03 GMT
Server: wiseguy/0.6.7
X-Content-Type-Options: nosniff
Set-Cookie: use_hitbox=72c46ff6cbcdb7c551314baddaa223b6b334edAEAAAAw; path=/; domain=.youtube.com
Set-Cookie: VISITOR_INFO1_LIVE=NCoKY7oOwwc; path=/; domain=.youtube.com; expires=Wed, 13-Jul-2011 12:11:03 GMT
Set-Cookie: PREF=f1=50000000; path=/; domain=.youtube.com; expires=Thu, 12-Nov-2020 12:11:03 GMT
Set-Cookie: GEO=2025f63e12369126b8e88f071eca33e84cwsAAAAzTVi7hMjLTOEitw==; path=/; domain=.youtube.com
Set-Cookie: watched_video_id_list=7dfa3328581111f35f5cbf22b34bd542WwEAAABzCwAAAHaa532aXp5MGs5bVpR; path=/; domain=.youtube.com
Expires: Tue, 27 Apr 1971 19:44:06 EST
Cache-Control: no-cache
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked[/text]
Post Reply