I am trying to get the video URL of any YouTube video like this:
Open
http://youtube.com/get_video_info?video_id=VIDEOID
then take the
Sorry, that is not possible anymore. They limit the token to the IP that got it.
Here's a workaround by using the get_headers()
function, which gives you an array with the link to the video. I don't know anything about ios
, so hopefully you can rewrite this PHP code yourself.
video_details;
$url_array = array ("http://youtube.com/get_video?video_id=".$id."&t=".$token,
"http://youtube.com/get_video?video_id=".$id."&t=".$token."&fmt=18");
if(url_exists($url_array[1]) === true) {
$file = get_headers($url_array[1]);
}
elseif(url_exists($url_array[0]) === true) {
$file = get_headers($url_array[0]);
}
$url = trim($file[19],"Location: ");
echo 'Download video';
}
?>