Hi all. Could any one show me how i can get youtube direct flv url using youtube url ? I know there programs that do that but i need to do it for a project that i work with. I found a php example but don't know how to convert it to vb6 so i be happy if some one help me convert it to vb6.Thanks
PHP Code:function get_link($url){
if ($html = file_get_contents($url)){
if(preg_match_all("/\b(?:video_id)\b:.*/", $html, $matches)){
$ref = $matches[0][0];
//echo $ref.'<br>';
preg_match_all("/\'[^\'\\\\\r\n]*(?:\\\\.[^\'\\\\\r\n]*)*\'/", $ref, $match);
//video_id:'WAvj0iY1Zig',l:'142',t:'OEgsToPDskLspgdtd49MOElkAv_WEJmW',sk:'2ZgBZFfneV2DzW3Zb8g2AAC1
//print_r ($match);
$id1 = str_replace("'", "", $match[0][0]);
$id2 = str_replace("'", "", $match[0][2]);
$id3 = str_replace("'", "", $match[0][3]);
$id = $id1.'&t='.$id2.'&sk='.$id3;
//echo $id;
$url = 'http://youtube.com/get_video.php?video_id='.$id;
$url = get_headers($url);
//$url = print_r($url);
$url = $url[9];
//echo $id;
$url = substr($url,10);
$url = $url.'.flv';
//echo $url;
return $url;
}
return false;
}
}




Reply With Quote