刘明野

PHP 解析皮皮虾无水印视频链接

PHP解析皮皮虾无水印视频后端代码
使用方法 http://www.yoursite.com/api.php?url=皮皮虾视频链接
在线工具 http://tool.liumingye.cn/pipixia/

<?php
/*
    author 刘明野
    site www.liumingye.cn
*/
function curl_request($url) {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Mobile Safari/537.36');
    curl_setopt($curl, CURLOPT_TIMEOUT, 30);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, '0');
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, '0');
    curl_setopt($curl, CURLOPT_HEADER, 0);
    $data = curl_exec($curl);
    if (curl_errno($curl)) {
        return curl_error($curl);
    }
    curl_close($curl);
    return $data;
}
$url = htmlspecialchars($_GET['url']);
if(preg_match("/[0-9]{19,19}/", $url, $a)){
    $data = curl_request('https://h5.pipix.com/bds/webapi/item/detail/?item_id=' . $a[0]);
    $data = json_decode($data, true);
    echo $data['data']['item']['video']['video_high']['url_list'][0]['url'];
}
本文为作者刘明野发布,未经允许禁止转载!
8235
0
0
发表留言

友情链接