还不如这个
https://imgcdn.bolgk.eu.org

修改过代码
<?php
if (class_exists('CURLFile')) {
$post['file'] = new CURLFile(realpath($FILES['Filedata']['tmp_name']));
} else {
$post['file'] = '@' . realpath($FILES['Filedata']['tmp_name']);
}
$rel = get_curl('https://search.jd.com/image?op=upload', $post);
preg_match('/callback(?:(\"))(.*)(?:\")/i', $rel, $matches);
if (!$matches[1]) {
exit('图片上传失败!');
}
$arr = array(
'code' => 200,
'imgurl' => 'https://img' . rand(10, 14) . '.360buyimg.com/uba/' . $matches[1]
);
exit(json_encode($arr));
function get_curl($url, $post = null, $referer = null, $cookie = null, $header = null, $ua = null, $nobody = null) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$httpheader = array(
"Accept:application/json",
"Accept-Encoding:gzip,deflate,sdch",
"Accept-Language:zh-CN,zh;q=0.8",
"Connection:close"
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
if ($post !== null) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
if ($header !== null) {
curl_setopt($ch, CURLOPT_HEADER, true);
}
if ($cookie !== null) {
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
}
if ($referer !== null) {
curl_setopt($ch, CURLOPT_REFERER, $referer);
}
if ($ua !== null) {
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
} else {
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Linux; U; Android 4.0.4; es-mx; HTC_One_X Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0");
}
if ($nobody !== null) {
curl_setopt($ch, CURLOPT_NOBODY, true);
}
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ret = curl_exec($ch);
curl_close($ch);
return $ret;
}
?>