{ "code": 200, "msg": "当前歌曲为免费歌曲,已获取完整音频", "data": { "title": "天空有雨 伞下有你(第十一届国际艾滋病反歧视午餐日主题曲)", "singer": "张杰", "lyric": "https://static-qianqian.taihe.com/0513/M00/79/C8/ChAKCGUk0SGACQTZAAAJ3bzhStY998.lrc", "cover": "https://img01.dmhmusic.com/0513/M00/79/C8/ChAKCGUk0SKAIrd5ABE7uWdu-LI024.jpg", "link": "https://music.91q.com/song/T10063107540", "music_url": "https://audio04.dmhmusic.com/71_53_T10063107540_128_4_1_0_sdk-cpm/cn/0105/M00/DE/A2/ChR45GKOA9mAZSB1AD8AY8Ow_58016.mp3?xcode=1931f9c4062e7e97e211cd477cc9df54d387b99" } }
<?php /** * Created by PhpStorm. * User: FZS * Time: 2024/5/10 07:11 */ class freeApi { private $apiUrl; public function __construct() { $this->apiUrl = 'https://api.cenguigui.cn/api/music/qianqian_music.php?msg=张杰&n=1'; } /** * 获取结果 * @return array */ public function getResult() { return file_get_contents($this->apiUrl); } }
package main import ( "fmt" "io/ioutil" "log" "net/http" ) const ( APIURL = "https://api.cenguigui.cn/api/music/qianqian_music.php?msg=张杰&n=1" ) func main() { queryUrl := fmt.Sprintf("%s",APIURL) resp, err := http.Get(queryUrl) if err != nil { log.Println(err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) }