• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

求个地址获取的代码详细请见帖子解决方案

php 搞代码 4年前 (2022-01-24) 14次浏览 已收录 0个评论

求个地址获取的代码详细请见帖子
比如土豆的视频地址为:http://www.tudou.com/a/OpofdZOE_mI/&iid=131686432&resourceId=0_04_05_99/v.swf
直接访问后为:
http://js.tudouui.com/bin/player2/olc_8.swf?iid=131686432&swfPath=http://js.tudouui.com/bin/lingtong/SocialPlayer_79.swf&youkuId=XNjc0MTE5MDky&vcode=XNjc0MTE5MDky&tvcCode=-1&tag=null&title=%E7%AC%AC07%E8%AF%9D+%E8%80%8D%E9%98%B4%E9%99%A9%E2%80%A6%E2%80%A6%21%21&mediaType=vi&totalTime=1434760&hdType=3&hasPassword=0&nWidth=512&isOriginal=0&channelId=9&nHeight=288&banPublic=false&videoOwner=102599789&tict=2&tvcCode=-1&channelId=9&cs=6_480|482&k=&totalTime=1434760&panelRecm=http://css.tudouui.com/bin/lingtong/PanelRecm_9.swz&panelDanmu=http://css.tudouui.com/bin/lingtong/PanelDanmu_1.swz&panelEnd=http://css.tudouui.com/bin/lingtong/PanelEnd_11.swz&pepper=http://css.tudouui.com/bin/binder/pepper_17.png&panelShare=http://c6本文来源gao@dai!ma.com搞$代^码!网7

搞gaodaima代码

ss.tudouui.com/bin/lingtong/PanelShare_7.swz&panelCloud=http://css.tudouui.com/bin/lingtong/PanelCloud_8.swz&prd=&autoPlay=false&listType=3&rurl=&resourceId=0_04_05_99&autostart=false&lid=0&aid=228258&aCode=OpofdZOE_mI&code=JH-1K_odtwE&snap_pic=http%3A%2F%2Fr1.ykimg.com%2F054104085301E3696A0A4F52041D537C&aopRate=0.001&p2pRate=0.95&adSourceId=81000&yjuid=1392279724827k3i&yseid=1392887009649TQcVcx&yseidtimeout=1392898462767&yseidcount=4&uid=null&juid=018h4v26uu19ca&vip=0
怎么样用PHP获取访问后的地址并输出
——解决方案——————–

$url='http://www.tudou.com/a/OpofdZOE_mI/&iid=131686432&resourceId=0_04_05_99/v.swf';<br />$ch = curl_init($url);<br />curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);<br />curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br />curl_setopt($ch, CURLOPT_HEADER, true);<br />curl_exec($ch);<br /><br />$response = curl_exec($ch);<br /><br />preg_match_all('/^Location:(.*)$/mi', $response, $matches);<br />curl_close($ch);<br /><br />echo !empty($matches[1]) ? trim($matches[1][0]) : 'No redirect found';

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:求个地址获取的代码详细请见帖子解决方案
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址