API代码
<?php /** * @package 158Pan * @author Andy * @version 1.2.0 * @link https://lsland.cn */ // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); header('content-type:application/json;charset:utf-8'); function object_array($array) { if(is_object($array)) { $array = (array)$array; } if(is_array($array)) { foreach($array as $key=>$value) { $array[$key] = object_array($value); } } return $array; } function Curl_Post($id){ $data = 'js={"appid":307,"avs":2,"bdb":0,"getlist":{"avs":2,"bdb":0,"c1":1,"inslog":"","proc":[{"id":"1"},{"id":"3"}],"reg":[{"id":714},{"id":848},{"id":894}],"reg2":[441,459,26282,29600,33143,18920,33144],"vm":0},"id":2052,"md5":"67b7a4442c20658c67819f5fda9559ba","msoft":"IU-斑马,斑马@307_251892.exe","sid":'.$id.',"st":0,"uid":"1aeccea753321c903309ee4943657276","ver":"4.0.0.1126","vm":0,"zn":8}'; $UserAgent = 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)';#设置UserAgent $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, "https://x.93ne.com/qy/gi"); //关闭SSL 表示不检查证书 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent); curl_setopt($curl, CURLOPT_HEADER, 0); //启用时会将头文件的信息作为数据流输出。这里不启用 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); //如果成功只将结果返回,不自动输出任何内容。如果失败返回FALSE curl_setopt($curl, CURLOPT_POST, 1); //如果你想PHP去做一个正规的HTTP POST,设置这个选项为一个非零值。这个POST是普通的 application/x-www-from-urlencoded 类型,多数被HTML表单使用。 curl_setopt($curl, CURLOPT_POSTFIELDS, $data); //需要POST的数据 curl_setopt($curl, CURLOPT_HTTPHEADER, array("application/x-www-form-urlencoded", "Content-length: ".strlen($data))); $rtn = curl_exec($curl); if(!curl_errno($curl)){ return $rtn; } else { echo 'Curl error: ' . curl_error($curl); } curl_close($curl); } $type = isset($_GET['type']) ? $_GET['type'] : ""; if (!empty($_GET['id'])) { $id = $_GET['id']; $result = json_decode(Curl_Post($id)); $result = object_array($result); $downUrl = $result["main"]["descr_downurl"]; if ($type != "down") { die( json_encode( array( 'code' => 200, 'msg' => '此API仅供于学习!', 'name' => $result["main"]["descr_name"], 'downUrl' => $downUrl ) , JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ); } else { header("Location:$downUrl"); die; } }else{ $result_url = str_replace("index.php","",$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?id=251892"); echo '演示:'.$result_url; } ?>
使用方法
?id=
示例:https://www.wdzzz.com/158/?id=251892
文档:https://www.wdzzz.com/158/api.php
- PHP全网视频解析下载网站源码 [2024-09-27]
- 抖音无水印解析PHP接口代码分享 [2024-09-23]
- cobalt多功能视频音乐解析下载工具,支持所有热门视频平台 [2024-08-31]
- ODE(窝的)百度网盘不限速解析下载工具V0.9.8 [2024-08-30]
- 懒人影院VIP视频解析网页源码 [2024-08-23]