官方 API 文档中未包含一些 Grooveshark 方法,但有一些 存储库记录了非官方 API 并包含这些方法。您正在寻找的方法是getSongFromToken.
它需要country和token作为参数(token在"2IsoC7"你的情况下)。您还需要设置header.client为"htmlshark".
这是一个示例 cURL 请求:
curl 'http://grooveshark.com/more.php?getSongFromToken' -H 'Content-Type: text/plain' --data-binary '{"header":{"client":"htmlshark","clientRevision":"20130520","uuid":"[YOUR-UUID]","session":"[YOUR-SESSION]","token":"[YOUR-SESSION-TOKEN]"},"method":"getSongFromToken","parameters":{"token":"fESpf","country":{"ID":223,"CC1":0,"CC2":0,"CC3":0,"CC4":1073741824,"DMA":534,"IPR":0}}}'
这应该给你一些看起来像这样的东西:
"header": {
"session":"[YOUR-SESSION]",
"serviceVersion":"20100903",
"prefetchEnabled":true
},
"result": {
"SongID":"25134723",
"Name":"T4 Song",
"Flags":"0",
"EstimateDuration":"227",
"AlbumID":"3624474",
"AlbumName":"Sexplosive Locomotive",
"CoverArtFilename":"3624474.jpg",
"ArtistName":"Punish Yourself",
"ArtistID":"249162"
}
不幸的是,其中一些变量的命名有点糟糕。token里面header是你的会话令牌。tokeninside ofparameters是您正在查找的歌曲的 id。
希望有帮助!