优化 图片抓取

This commit is contained in:
六零 2022-12-01 12:59:39 +08:00
parent d3fe15bb6a
commit e5cdb50e0e

View File

@ -43,6 +43,8 @@ function download_img($url,$referer="") {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_ENCODING,'gzip');
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_MAXREDIRS,5);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
if(!empty($referer)){curl_setopt($ch, CURLOPT_REFERER,$referer);}
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);