If you download an Youtube video using Internet Download Manager(IDM) you get the actual download url from properties>address and the url looks like following.
if I put the following code in a file and click "Save As" the video starts downloading.
<a href="$link">Download Video</a> // $link = the above link
Now I have a file called video.php. What I am trying to do is when I will run the video.php file my code will start downloading the video from the url (like above url) automatically. Is this even possible? If then could you please tell me how to do that?
I have tried to download using PHP but the page keeps loading and loading and does not show anying. The code I tried is following:
$ch = curl_init ($link); // $link = the above link
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec ($ch);
Since direct connection to videos on port 80 is forbidden you would need to use some other way. I can imagine using some kind of background RTMP streamer on port 554 which is usually open, since is used for Flash video as default.
RTMPDump can do the job -> http://rtmpdump.mplayerhq.hu/