PHP Glype Proxy Youtube Plugin Update

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
assault14
Forum Newbie
Posts: 1
Joined: Fri Jun 18, 2010 4:07 am

PHP Glype Proxy Youtube Plugin Update

Post by assault14 »

hey, i was wondering if someone here could please update the youtube.com.php plugin for glype, here is the code - it currently dosnt work, i belive that the praseing needs to be reworked, witch is over my head please help me out thanks.

Code: Select all

<?php
##############################################
# Plugin: YOUTUBE.COM
##############################################

/* ABOUT ---------------------------------
/ This plugin replaces the default YouTube video player
/ with our own player that loads the flv file through
/ the proxy.
-----------------------------------------*/

##########################################
# STOP ENCODING TO PREVENT PROBLEMS
##########################################
$options['encodePage']=false;

##########################################
# REMOVE NON-WORKING FLASH OBJECTS
##########################################
$options['stripFlash']=true;

##########################################
# EXTRA PARSING AFTER MAIN PROXY PARSER
##########################################
function postParse($html,$type){

    if($type=='html'&&preg_match('/fullscreenUrl\s\=\s.*video\_id\=(.*)\&.*\&t\=(.*)\&/i',$html,$matches)){
        $thumbid_arr=explode('&',basename($matches[1]));
        $thumbid=array_shift($thumbid_arr);
        $html=preg_replace('#<div id="watch-checker-div">(.*)to.write\("watch-checker-div"\);#is','<embed src="'.optURL.'videoplayer.swf" width="480" height="395" allowscriptaccess="always" allowfullscreen="true" flashvars="height=395&width=480&file='.proxifyURL('http://youtube.com/get_video?video_id='.$matches[1].'&t='.$matches[2]).'&image='.proxifyURL('http://i.ytimg.com/vi/'.$thumbid.'/0.jpg').'&backcolor=0x000000&frontcolor=0xCCCCCC&lightcolor=0x996600&searchbar=false&type=flv" menu="false" />'.'<script type="text/javascript">',$html);

    }

    return $html;
}

?>
heres a link to the proxy - http://www.glype.com/downloads/fetch/proxy/53

and heres a link to the plugin - http://www.mediafire.com/?ohkjynm2ngy

thank you
Post Reply