【问题标题】:Getting direct link form redirect link via lh3.googleusercontent.com通过 lh3.googleusercontent.com 获取直接链接表单重定向链接
【发布时间】:2015-11-20 10:16:34
【问题描述】:

如何在php中获取url重定向

就像你在浏览器中填写一样

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

成为

---//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=IgpwcjAxLmMChrZvideo=/Kplkx=19Ej MP4&LMT = 1438597716404239&MT = 1448012195&IP = 14.162.103.141&ipbits = 8&到期= 1448041095&sparams = IP,ipbits,到期,ID,ITAG,来源,requiressl,毫米,MN,MS,MV,NH,PL,MIME,LMT&签名= 06D26A3C592DD99A4E7E2BC04747E3022AD30071.09139E1F57105925D9BF39F6BE152E7068350D40&键= CK2 ---

我尝试了一个代码

<?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=m 1448012329&IP = 2604:A880:800:A1 :: 75:6001&ipbits = 48&到期= 1448042024&sparams = IP,ipbits,到期,ID,ITAG,来源,requiressl,毫米,MN,MS,MV,PL,MIME,LMT&签名= 9259AF5059FA660980BB65F95637C73690207B67.3F352385B6D53E5FF4938A859338554D90173F7A&键=ck2

我很高兴,但它没有运行。

非常感谢!

【问题讨论】:

  • 您从哪里获得 lh3.googleusercontent.com 链接?
  • 你好,你能告诉我如何获得lh3.googleusercontent.com链接吗?

标签: php url video


【解决方案1】:

我知道您要做什么,但视频无法播放,因为您收到的响应不包含 Access-Control-Origin-Policy 标头。这意味着浏览器无法访问没有该标头的响应接收。这是出于安全目的。无论如何,要解决这个问题,您必须将https://r2---sn-i3b7kn7z 部分替换为https://redirector

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-08-07
    • 2015-07-18
    • 2017-12-18
    • 2014-06-29
    • 2012-01-13
    • 2014-08-17
    • 2012-06-13
    相关资源
    最近更新 更多