我已经建立了一个代码从获得Algo最新更新代码一段时间之前这是完美的工作,但昨天晚上这不起作用我尝试了许多解决这个问题,但我失败了我无法理解问题在哪里
我试试这里是我的代码
function curl($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
$uaa = $_SERVER['HTTP_USER_AGENT'];
curl_setopt($ch, CURLOPT_USERAGENT, "User-Agent: $uaa");
$exec=curl_exec($ch);
curl_close($ch);
return $exec;
}
$url = 'https://www.jwz.org/hacks/youtubedown';
$data = curl($url);
$rep = str_replace("' => '", "", $data);
$date = date('M Y');
$explode = explode($date, $rep);
$co = count($explode);
$min = $co - 2;
$act_explode = $explode[$min];
$exp_algo = explode('base', $act_explode);
$exp_algo_sts = $exp_algo[1];
$replace_extra = substr($exp_algo_sts, 0, -7);
$exp_sts = explode(' ', $replace_extra);
$exp_algo_sts = $exp_sts[0];
$exp_algo_algo = str_replace($exp_algo_sts,'',$replace_extra);
$algo = substr($exp_algo_algo, 1);
$final = '{"sts":'.$exp_algo_sts.',"algo":"'.$algo.'"}';
header('Content-type: application/json');
file_put_contents('algo-key.txt',$final);
echo $final;
文本文件格式的输出是 {" sts":" 17494"," algo":" w45 w69 w2 r s1 r s1 r"}
如何解决此问题