My modified version of youtube plugin:
/*****************************************************************
* Override options for this site
******************************************************************/
// Increase timeout to 60 minutes
$toSet[CURLOPT_TIMEOUT] = 0;
// Strip javascript to simplify the page and stop existing javascript intefering
//$options['stripJS'] = false;
//dont need this
/*****************************************************************
* Pre-parsing applied BEFORE main proxy parser
******************************************************************/
function preParse($input, $type) {
switch ( $type ) {
case 'html':
if(preg_match('/"t"\: "([-a-zA-Z0-9_]{43})/',$input,$tValue)) {
define('T_VALUE',$tValue[1]);
}
if(preg_match('/"video_id"\: "([-a-zA-Z0-9_]{11})/',$input,$videoId)) {
define('VIDEO_ID',$videoId[1]);
}
// Remove noscript message
$input = preg_replace('#\