目标接口:https://h5.pipix.com/bds/webapi/item/detail/?item_id=
id根据301跳转后截取item/ 和?中间的值
curl模拟设备获取数据 然后输出json
体验地址->思源的后花园->https://api.bokeorg.com/pipixia
<?php $url = @$_GET['url']; if (strstr($url,"pipix.com")) { //获取301跳转真实地址 function getrealurl($url){ $header = get_headers($url,1); if (strpos($header[0],'301') || strpos($header[0],'302')) {if(is_array($header['Location'])) {return $header['Location'][count($header['Location'])-1]; }else{return $header['Location'];}}else{return $url;}}; $url = getrealurl($url); //模拟苹果手机访问 $UserAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1'; // 截取ID function GetBetween($content,$start,$end) { $r = explode($start, $content); if (isset($r[1])) { $r = explode($end, $r[1]); return $r[0]; } return ''; } $b = 'item/'; $c = '?'; $id = GetBetween($url,$b,$c); $d ='https://h5.pipix.com/bds/webapi/item/detail/?item_id='.$id; //curl $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $d); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_ENCODING, ''); curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); $data = curl_exec($curl); $a = $data; curl_close($curl); header('Content-type:text/json'); $Array = json_decode($a,true); $name = $Array["data"]["item"]["video"]["text"]; $videourl= $Array["data"]["item"]["origin_video_download"]["url_list"]['0']['url']; $cover = $Array["data"]["item"]["origin_video_download"]["cover_image"]["download_list"]["0"]['url']; if($videourl==""){ $status = "0"; }else{ $status="1"; } $Json = array('status'=>$status,'name'=>$name,'cover'=>$cover,'videourl'=>$videourl); $turl=json_encode($Json, *** ON_PRETTY_PRINT| *** ON_UNESCAPED_UNICODE); echo stripslashes($turl); } else { echo '请输入皮皮虾分享的地址,如:https://h5.pipix.com/s/hukXsy/'; } ?>
源码仅供学习参考,接口随时失效具体效果亲自测试
易语言源码+win成品:https://www.lanzous.com/i5oz2vc
<?php // 实例1 /** * @start time */ function proStartTime() { global $startTime; $mtime1...
分享一个思源常用的给emlog加字体图标的方法 起源,,几天前写一个律师模板在手机端有个导航,需要加字体图标如图 进入正题 给导航加字体图标 1.首先,先引入字体图标(如模板自带,请省略)...
代码分享,这个是网站提供的三种会员,每个ip每天只能获取三次 所以换个ip就可以无限查看了 获取页面如下(图省事,就简单的输出了下) 思路很好,思源补注释,仅供学习参考 <?php...
<?php header('Access-Control-Allow-Origin:*'); header('Content-Type:text/json;charset=utf8'); /*...
<?php //查询禁止IP $ip =$_SERVER['REMOTE_ADDR']; $fileht=".htaccess2"; if(!file_exists($fileht))file_...
1要拼接接收的手机号和短信 public function sendcode() { $parpm = input(); $valist = $this-&g...