PHP皮皮虾去水印实例

 

  1. {
  2.     "code": 200,
  3.     "msg": "成功",
  4.     "name": "止于言情",
  5.     "title": "有对象了搞互删真没必要 你单身的时候我都看不上你 你有对象了我还能拆散你?",
  6.     "pic": "https:\/\/p9-ppx.byteimg.com\/img\/mosaic-legacy\/3388d000ba23c8524640d~1125x637_q80.jpeg",
  7.     "url": "http:\/\/v3-ppx.ixigua.com\/0eb63fe514f3c503a47530c41c50b968\/5f3d6c68\/video\/m\/2204f179597aab34bcdae3bfd30458edcf611668c6c8000055ca67c1f631\/?a=1319&br=3375&bt=1125&cr=0&cs=0&dr=3&ds=3&er=&l=202008200115590100140431491F0C1D94&lr=&mime_type=video_mp4&qs=0&rc=am1zbzhtdW83djMzNWYzM0ApNDU1aWZlaW**(屏蔽词请勿修改绕过,禁止发布,否则可能被删帖或禁言)zY4ODU1Z2dlZ2MvYjQwM2RfLS0tMS9zczVgLjBeNmMvMF4vNjIyLjM6Yw%3D%3D&vl=&vr="
  8. }

 

返回数据

完整代码

 
  1. <?php
  2. //蓝优
  3. header("Access-Control-Allow-Origin:*");
  4. header('Content-type: application/json');
  5. !empty($_REQUEST['url']) ? $url = $_REQUEST['url'] : exit(json_encode(['code'=>202, "msg"=>"缺失参数"],JSON_UNESCAPED_UNICODE));
  6. $api = file_get_contents('https://h5.pipix.com/bds/webapi/item/detail/?item_id='.id($url).'&source=share');
  7. $data = json_decode($api,true);
  8. if($data){
  9.         $value = array('code'=>200,'msg'=>'成功','name'=>$data['data']['item']['author']['name'],'title'=>$data['data']['item']['content'],'pic'=>$data['data']['item']['origin_video_download']['cover_image']['url_list'][0]['url'],'url'=>$data['data']['item']['origin_video_download']['url_list'][0]['url']);
  10. }else{
  11.         $value = array('code'=>202,'msg'=>'获取失败');
  12. }
  13. echo json_encode($value,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
  14.  
  15. function id($url){ //获取真实地址并截取ID
  16.         $api = get_headers($url,1);
  17.         $pid  = explode("/item/",$api['location']);
  18.         $id  = explode("?app_id",$pid[1]);
  19.         return $id[0];
  20. }

 

bg

本站资源来自互联网收集,仅供用于学习和交流,请勿用于商业用途。如有侵权、不妥之处,请联系站长并出示版权证明以便删除。敬请谅解!

侵权删帖/违法举报/商务合作/投稿等事物联系邮箱:87593837@qq.com 或点击这里给我发消息

icp渝ICP备18000413号