稳定、快速、免费的 API 接口服务
酷我音乐下载,不能下载会员的音乐
接口地址: http://125.64.3.73:6688/api/kuwo
返回格式: JSON
请求方式: GET
请求示例: http://125.64.3.73:6688/api/kuwo?url=https://www.kuwo.cn/play_detail/183881132
请求参数说明:
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
url | 是 | string | 酷我音乐地址 |
type | 否 | string | 默认情况下是json返回,若type=play,返回一个播放页面 |
text | 否 | string | 链接支持:down/single/228908 | play_detail/228908 | /down/single/228908 |
id | 是 | string | ID = 228908 =>down/single/228908 | play_detail/228908,跟url只能选一个 |
返回参数说明:
名称 | 类型 | 说明 |
---|
返回示例:
Array ( [code] => 200 [url] => https://lu-sycdn.kuwo.cn/af983ef2bd12fe90a8554ac9a6b914b8/643ffb4a/resource/n1/91/96/3073517249.mp3 [kwid] => 263595469 [songName] => 想去风吹的地方 [songTimeMinutes] => 03:31 [pic] => http://img1.kwcdn.kuwo.cn/star/albumcover/240/19/36/3552640587.jpg )
请求参数设置:
参数名称 | 参数值 |
---|---|
Array ( [code] => 200 [url] => https://lu-sycdn.kuwo.cn/af983ef2bd12fe90a8554ac9a6b914b8/643ffb4a/resource/n1/91/96/3073517249.mp3 [kwid] => 263595469 [songName] => 想去风吹的地方 [songTimeMinutes] => 03:31 [pic] => http://img1.kwcdn.kuwo.cn/star/albumcover/240/19/36/3552640587.jpg )
错误码格式说明:
名称 | 类型 | 说明 |
---|
代码示例:
<?php
header("Content-Type:text/json;charset=UTF-8");
$id = $_GET['id'];
$api = "http://125.64.3.73:6688/api/kuwo?url=http://www.kuwo.cn/play_detail/263595469" ;
$url = XingJi($api);
echo $url;
function XingJi($url)
{
$ch = curl_init();
$timeout = 30;
$ua= $_SERVER['HTTP_USER_AGENT'];
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
$urls = $http_type . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER,$urls);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:'.$ip, 'CLIENT-IP:'.$ip));
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
$content = curl_exec($ch);
curl_close($ch);
return $content;
}
?>