通过lh3.googleusercontent.com获取直接链接表单重定向链接

How to get url redirect in php

Like you fill it in browser

---https://lh3.googleusercontent.com/1I1FrmTThL6inx681XYApSPq5wrixuVzVvRZPiTHsiA=m22---

become

---//r2---sn-i3b7kn7z.googlevideo.com/videoplayback?id=d8c2e2b465cd28a7&itag=22&source=picasa&begin=0&requiressl=yes&mm=30&mn=sn-i3b7kn7z&ms=nxu&mv=m&nh=IgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE&pl=19&mime=video/mp4&lmt=1438597716404239&mt=1448012195&ip=14.162.103.141&ipbits=8&expire=1448041095&sparams=ip,ipbits,expire,id,itag,source,requiressl,mm,mn,ms,mv,nh,pl,mime,lmt&signature=06D26A3C592DD99A4E7E2BC04747E3022AD30071.09139E1F57105925D9BF39F6BE152E7068350D40&key=ck2---

I tried with a code

<?php

      $ch = curl_init("//lh3.googleusercontent.com/gNqSDOMdfLcZDOv1j7TGfEQSzXrk0ngBSloMd6JSjGQ=m22");
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); 
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
      curl_setopt($ch, CURLOPT_HEADER, true); 
      curl_setopt($ch, CURLOPT_NOBODY, true); 
      $response = curl_exec($ch); 
      $resolved = curl_getinfo($ch); 
      echo $resolved['url']; 
  ?>

://r8---sn-ab5l6nel.googlevideo.com/videoplayback?id=f091f46ecaa177ea&itag=22&source=picasa&begin=0&requiressl=yes&mm=30&mn=sn-ab5l6nel&ms=nxu&mv=u&pl=48&mime=video/mp4&lmt=1438598135161434&mt=1448012329&ip=2604:a880:800:a1::75:6001&ipbits=48&expire=1448042024&sparams=ip,ipbits,expire,id,itag,source,requiressl,mm,mn,ms,mv,pl,mime,lmt&signature=9259AF5059FA660980BB65F95637C73690207B67.3F352385B6D53E5FF4938A859338554D90173F7A&key=ck2

I was delighted, but it does not run.

Thank you very much!

I know what you are trying to do and the video does not play, because the response you receive will not contain the Access-Control-Origin-Policy header. Which means browser cannot access the response receive without that header. It's for security purposes. Any how, to solve this, you have to replace the https://r2---sn-i3b7kn7z part with https://redirector.