metowolf / Meting

:cake: Wow, such a powerful music API framework
MIT License
1.71k stars 489 forks source link

网易云获取歌曲封面地址无效 #102

Closed ayachi-core-001 closed 3 years ago

ayachi-core-001 commented 3 years ago

rt

ayachi-core-001 commented 3 years ago

示例地址:https://music.163.com/#/song?id=505474379 返回结果:{"url":"https:\/\/p3.music.126.net\/5etI5_rVt4IEUAdgAzrr8w==\/505474379.jpg?param=300y300"} 最终结果:404

metowolf commented 3 years ago
$data = $api->format(true)->song('505474379');
/*
[
  {
    "id": 505474379,
    "name": "病名は愛だった",
    "artist": [
      "Neru",
      "鏡音リン",
      "鏡音レン"
    ],
    "album": "アルカロイドに溺れる",
    "pic_id": "109951163023679798",
    "url_id": 505474379,
    "lyric_id": 505474379,
    "source": "netease"
  }
]
*/

经确认,这首歌曲的 pic_id 为 109951163023679798,需要使用 pic_id 进行获取

$data = $api->format(true)->pic('109951163023679798');

/*
{
  "url": "https://p3.music.126.net/0r3rPTmSp_qGMqR31PvXyg==/109951163023679798.jpg?param=300y300"
}
*/