我尝试使用来自subscene.com的curl下载zip文件
喜欢此网站:http://tinysub.us/subtitles/mad-max-fury-road/english/1139220
点击"下载英文字幕"网站正在工作并开始下载zip文件。
但是它将对象移到这里错误
<?php
if(isset($_GET['link'])) {
$endlink = $_GET['link'];
echo get("http://subscene.com/" . $endlink);
}
else
echo get("http://subscene.com/");
function get($link) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); // timeout
return $html = curl_exec($ch);
curl_close($ch);
}
?>