<?php /* PHP正则解析虎牙视频地址 ** 2016-08-04 by lanye.org ** 演示 http://music.lanye.org */ error_reporting(0); $videoid = isset($_GET['id']) ? addslashes(trim($_GET['id'])) : ''; if(!empty($videoid)){ $url = 'http://m.v.huya.com/play/'.$videoid.'.html'; $refer = 'http://m.v.huya.com/play/'.$videoid.'.html'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); curl_setopt($ch, CURLOPT_REFERER, $refer); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30'); $output = curl_exec($ch); curl_close($ch); preg_match('|video src="(.*?)"|i', $output, $endput); $videourl = $endput[1]; header("Location:".$videourl); }else{echo '视频ID错误,请输入视频ID号码。BY LANYES.ORG';} ?>
免责声明:
本页网址:点击复制分享给朋友吧!
本站分享的一切内容资源如若没有备注,均为蓝叶原创,如需转载请注明出处;如有侵权请与我们联系处理。敬请谅解!
提示