现在某手APP分享按钮复制地址,然后通过浏览器打开,复制真实地址后通过以下代码调用便可,有能力的自己在改进一下就好。
<?php
//快手图集图片抓取代码
//echo CURL('https://m.gifshow.com/fw/photo/3xdxz698bpepins?did=web_08c3398586b24753b8c512322ef5b12e');
echo CURL('https://m.gifshow.com/fw/photo/3xb4grfs6qrpsa2?did=web_08c3398586b24753b8c512322ef5b12e');
function CURL($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
$h=array('User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1');
curl_setopt($ch, CURLOPT_HTTPHEADER, $h);
$output = curl_exec($ch);
curl_close($ch);
return PImg($output);
}
function PImg($data){
$str = '<img class="play-long-image" src="(.+?)">';//正则规则
preg_match_all($str,$data,$match);
$match_array = str_replace('//','http://', $match[1]);//转译为http
return json_encode($match_array);
} 复制代码
评分
查看全部评分