PHP皮皮虾去水印解析API实例

本文是PHP皮皮虾去水印解析API实例

  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 = https://www.fyby2.com/news/json_decode($api,true);
  8. if($data){
  9. $value = https://www.fyby2.com/news/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 = https://www.fyby2.com/news/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]);

    推荐阅读