[MPlayer-dev-eng] [PATCH] HTTP streaming over YouTube.com

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Aug 14 16:21:59 CEST 2006


Hello,
On Thu, Aug 10, 2006 at 11:07:40PM +0200, Benjamin Zores wrote:
> YouTube provides videos under the following form :
> http://www.youtube.com/watch?v=video_id
> 
> which are HTML page that need to be parse to retrieve the hidden URL of the video.

I really think this kind of code belongs in a web browser, not a movie
player.
But regardless of that, stream/http.c really has already so much stuff
in it, and last but not least I don't think this belongs in the stream
layer at all, but if anything should be a playlist parser, or is that
not possible for some reason?


> @@ -829,6 +832,7 @@
>  			// Redirect
>  			case 301: // Permanently
>  			case 302: // Temporarily
> +			case 303: // See Other
>  				// TODO: RFC 2616, recommand to detect infinite redirection loops
>  				next_url = http_get_field( http_hdr, "Location" );
>  				if( next_url!=NULL ) {

This probably might be a good idea to apply separately though?


> +        /* check for a valid YouTube.com URL */
> +        if (!strstr(stream->url,URL_YOU_TUBE_WATCH))
> +          return STREAM_UNSUPORTED;

And really, such a hack for one single web page? IMHO we should start
that, after all there are billions of web pages, in a few years MPlayer
would contain more URLs that code :-P

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list