我需要filmix.net/uzhasy/14482-tayna-bermudskogo-treugolnika-the-bermuda-triangle-1987.html 獲得FLV文件。當我通過瀏覽器鏈接轉到服務器。 flv文件,我發現它可以保存文件。服務器如何認識到這不是一個人?
而當我做一個PHP腳本,鏈接不起作用。
video-10.filmix.net/s/37d6764a8f8e43bd754f53431c2e79ce/_02/The.Bermuda.Triangle.1978.DVDRip.flv - 工作 video-10.filmix.net/s/d93d70a78428816b714882c678c39230/_02/The.Bermuda。 Triangle.1978.DVDRip.flv - 不起作用。
我已經試過這樣:
$viart_xml = fsockopen("filmix.net", 80, $errno, $errstr, 12);
fputs($viart_xml, "GET /uzhasy/14482-tayna-bermudskogo-treugolnika-the-bermuda-triangle-1987.html HTTP/1.1\r\n");
fputs($viart_xml, "Host: filmix.net\r\n");
fputs($viart_xml, "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13\r\n\r\n");
fputs($viart_xml, "Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3\r\n");
fputs($viart_xml, "Accept-Encoding: gzip,deflate\r\n");
fputs($viart_xml, "Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7\r\n");
fputs($viart_xml, "Keep-Alive: 115\r\n");
fputs($viart_xml, "Connection: keep-alive\r\n\r\n");
if (!$viart_xml) {
echo "$errstr ($errno)<br />\n";
} else {
$content = "";
while (!feof($viart_xml)) {
$content .= fgets($viart_xml, 1000000);
}
fclose($viart_xml);
echo $content;
末:
function download_pretending($url,$user_agent='Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)')
{
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_REFERER, 'www.yandex.ru');
$result = curl_exec ($ch);
curl_close ($ch);
return $result;
爲什麼鏈接有什麼不同?
Cookie:名稱評論值1常量 – Mediator 2011-01-29 00:32:02
這100%不是cookie! – Mediator 2011-01-29 01:02:34