title: Serve external file download with php
body: <p>I am trying to make a personal youtube video downloader using some snippets i found on the web. I get a url which is given by youtube which is only useful for the ip that requested it, so it is only working on localhost, because when its on a web server, download fails since the IP that requested the download link (web server one) is not the same as the client downloading it (me). My question is if there is some kind of way to:</p>
  
  <p>a) Download video to web server and then download to my pc from there (not the best one)</p>
  
  <p>b) Make youtube think that the webserver is downloading it when in real its me who is downloading the video using the web server.</p>
  
  <p>URLs look like this: </p>
  
  <p><a href="http://o-o---preferred---ams03s12---v13---lscache7.c.youtube.com/videoplayback?upn=TGDxfz8IZxI&amp;sparams=cp%2Cgcr%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&amp;fexp=917000%2C903802%2C901425%2C920917%2C922401%2C920704%2C912806%2C924412%2C913558%2C912706&amp;key=yt1&amp;itag=18&amp;ipbits=8&amp;signature=4F0668E4E49852653FA995D28FECC455B552327D.3DEB3B58D1C5343B5EA03B7DA21355326EF29B7E&amp;mv=m&amp;sver=3&amp;mt=1347451352&amp;ratebypass=yes&amp;source=youtube&amp;ms=au&amp;gcr=es&amp;expire=1347475934&amp;ip=95.39.206.66&amp;cp=U0hTTFRSU19ITkNOM19MTFdKOkVhV2otM1FhTXNj&amp;id=2b4258153228ebc9" rel="nofollow">http://o-o---preferred---ams03s12---v13---lscache7.c.youtube.com/videoplayback?upn=TGDxfz8IZxI&amp;sparams=cp%2Cgcr%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&amp;fexp=917000%2C903802%2C901425%2C920917%2C922401%2C920704%2C912806%2C924412%2C913558%2C912706&amp;key=yt1&amp;itag=18&amp;ipbits=8&amp;signature=4F0668E4E49852653FA995D28FECC455B552327D.3DEB3B58D1C5343B5EA03B7DA21355326EF29B7E&amp;mv=m&amp;sver=3&amp;mt=1347451352&amp;ratebypass=yes&amp;source=youtube&amp;ms=au&amp;gcr=es&amp;expire=1347475934&amp;ip=95.39.206.66&amp;cp=U0hTTFRSU19ITkNOM19MTFdKOkVhV2otM1FhTXNj&amp;id=2b4258153228ebc9</a></p>
  
  <p>If you change the IP in that url to yours will still dont work, I already tried with that.</p>