All pastes #946571 Raw Edit

Untitled

public php v1 · immutable
·published 2008-03-17 19:59 UTC
rendered paste body
//worlds smallest youtube FLV ripper class, by meh!class cYoutubeVideo	{		var $rawPageData;		var $jsClass;				function cYoutubeVideo( $video_url )		{			$this->rawPageData		= getUrlData( $video_url );			$this->GrabJavascriptData();		}				function GrabJavascriptData()		{			if( preg_match( '/var swfArgs = (.*);/', $this->rawPageData, $matches ) )			{				$this->jsClass = json_decode( $matches[1] );			}		}				function GetVideoFLV( )		{			return 'http://youtube.com/get_video?video_id='.$this->jsClass->video_id.'&t='.$this->jsClass->t;		}				//additional functions would go here	}