I want to display the size of youtube video size on the direct link. I have a link to an mp4 format file that is 98 MB in size. I want to display the size when you browse this link your will get file.
Direct url link:
$url ='https://r4---sn-a8au-p5qs.googlevideo.com/videoplayback?signature=9216B94F5EA16F023DE3D34C6881F8AFA20E1EBA.4B56920C4B2BAB848AC847E0EB4C1E01FB01685C&itag=22&ratebypass=yes&expire=1424904527&id=o-AA8OyXA6gxAGHzkwqf94rIO0LTrhD8iHuUc9lMI9ED76&pl=46&fexp=905657%2C907263%2C916942%2C923382%2C927622%2C934601%2C934954%2C9406984%2C943917%2C947225%2C947240%2C947601%2C948124%2C951703%2C952302%2C952605%2C952612%2C952901%2C955301%2C957201%2C959701&mm=31&ipbits=0&dur=1366.192&mt=1424882845&ms=au&key=yt5&upn=SIiUMnjm5o0&source=youtube&sparams=dur%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cmm%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&mv=m&initcwndbps=1567500&ip=2001%3A4802%3A7805%3A101%3Abe76%3A4eff%3Afe20%3A31e4&sver=3&requiressl=yes&title=PHP%3A+Create+Your+Own+MVC+%28Part+1%29';
php curl code I am using to get code
function retrieve_remote_file_size($url){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_NOBODY, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec($ch);
$size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
curl_close($ch);
return $size;
}
It is giving me 1419. How do I get the correct file size?