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

180it 2020-03-02 AM 2669℃ 0条
<?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'];
}
支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

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