21,886
社区成员
发帖
与我相关
我的任务
分享
<?php
$headers = array(
'Host: nitroflare.com',
'User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36',
'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language: zh-cn,zh;q=0.9',
);
$cs = curl_init();
curl_setopt($cs, CURLOPT_URL,'https://nitroflare.com/view/26016A32E5FAFE0/Vol_13_standing_on_the_shoulders_of_giants.pdf');
curl_setopt($cs, CURLOPT_HTTPHEADER, $headers);
curl_setopt($cs, CURLOPT_RETURNTRANSFER,1);
curl_setopt($cs, CURLOPT_CONNECTTIMEOUT,60);
curl_setopt($cs, CURLOPT_TIMEOUT,15);
curl_setopt($cs, CURLOPT_HEADER, 1);
curl_setopt($cs, CURLOPT_NOBODY, 1);
curl_setopt($cs, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($cs, CURLOPT_SSL_VERIFYHOST, FALSE);
$html = curl_exec($cs);
curl_close($cs);
echo $html;
?>
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6\r\n".
"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36 Edg/86.0.622.63\r\n"
)
);
$context = stream_context_create($opts);
$url = 'https://nitroflare.com/view/26016A32E5FAFE0/Vol_13_standing_on_the_shoulders_of_giants.pdf';
// Open the file using the HTTP headers set above
file_get_contents($url, false, $context);
var_dump($http_response_header);
最后,解决了麻烦也告知一下到底是什么问题