<?php
/*
 * @Author: Qicloud
 * @Date: 2020-10-12 23:38:12
 * @Title: 酷我音乐
 * @Project: 酷我音乐解析
 * @QQ: 66547997
 * @当浑浊变成一种常态,清白就是一种罪。
 */
$id = @$_GET['id'];
//音乐真实地址
$arr = file_get_contents('https://www.kuwo.cn/url?format=mp3&response=url&type=convert_url3&br=128kmp3&from=web&t=1569587300382&reqId=4a567af1-e122-11e9-bade-01a02613b222&rid=' . $id);
//音乐详情
$info = file_get_contents('http://m.kuwo.cn/newh5/singles/songinfoandlrc?httpsStatus=1&reqId=a4603bd0-0c96-11eb-942b-4365808395bd&musicId=' . $id);
$arr = json_decode($arr, true);
$info = json_decode($info, true);
$array = array(
    'id' => $id,
    'url' => $arr['url'],
    'form' => $info['data']['songinfo']['album'],
    'author' => $info['data']['songinfo']['artist']
);
//输出
print_r(json_encode($array));

返回格式:{"id":"152777242","url":"https:\/\/gg-sycdn.kuwo.cn\/b36ac920b022d33e1e85c92b5f86bb03\/5f847d5e\/resource\/n3\/55\/60\/3835955246.mp3","form":"\u6211\u4eec\u7684\u6b4c","author":"\u5f20\u4e00\u9e23&\u6881\u9f99&\u738b\u6670"}

最后修改:2020 年 10 月 13 日 12 : 03 AM
如果觉得我的文章对你有用,请随意赞赏