让代码更简单

新版酷狗音乐api接口

重要:本文最后更新于2023-07-28 20:52:28,某些文章具有时效性,若有错误或已失效,请在下方留言或联系代码狗

前几年狗哥分享过酷狗音乐的api接口,通过接口可以获取音乐数据。然而好景不长,酷狗直接限制了音乐文件大小,导致只能听前一分钟,甚至修改了接口,返回404,真是可恶。丑话说前面,本教程不能获取vip音乐,以及有版权限制的音乐!

搜索API接口仍然可用,详情请看:酷狗音乐直链解析接口免费下载付费音乐

其中获取播放数据的接口发生了变化,使用下面的接口替换即可。

请求方式:GET

复制
http://wwwapi.kugou.com/yy/index.php?r=play/getdata&hash=上一步获得的音乐文件hash值&album_id=专辑ID&album_audio_id=专辑音乐ID&_=时间戳&appid=1014&mid=56bbbd2918b95d6975f420f96c5c29bb

返回结果

复制
{
    "status": 1,
    "err_code": 0,
    "data": {
        "hash": "109AE8F573993168EFBE63072EB0BFB2",
        "timelength": 256522,
        "filesize": 4104929,
        "audio_name": "Lara梁心颐、周杰伦 - 珊瑚海",
        "have_album": 1,
        "album_name": "下雨天",
        "album_id": "2590774",
        "img": "http://imge.kugou.com/stdmusic/20160908/20160908001027394833.jpg",
        "have_mv": 0,
        "video_id": 0,
        "author_name": "Lara梁心颐、周杰伦",
        "song_name": "珊瑚海",
        "lyrics": "[id:$00000000]\r\n[ti:珊瑚海]\r\n[ar:Lara梁心颐/周杰伦]\r\n[al:下雨天]\r\n[by:]\r\n[00:00.00]珊瑚海 - Lara梁心颐 (lara Liang)/周杰伦 (Jay Chou)\r\n[00:02.52]词:方文山\r\n[00:05.05]曲:周杰伦\r\n[00:07.57]编曲:钟兴民\r\n[00:10.10]制作人:周杰伦\r\n[00:12.63]男:\r\n[00:15.16]海平面远方开始阴霾\r\n[00:21.70]悲伤要怎么平静纯白\r\n[00:27.39]我的脸上始终挟带\r\n[00:33.78]一抹浅浅的无奈\r\n[00:41.24]女:\r\n[00:41.63]你用唇语说你要离开\r\n[00:45.30]男:\r\n[00:45.58]心不在\r\n[00:47.47]合:\r\n[00:48.10]那难过无声慢了下来\r\n[00:53.55]汹涌潮水你听明白\r\n[01:00.03]不是浪而是泪海\r\n[01:06.08]男:\r\n[01:06.78]转身离开\r\n[01:08.33]女:\r\n[01:08.39]你有话说不出来\r\n[01:10.60]男:\r\n[01:10.60]分手说不出来\r\n[01:11.95]合:\r\n[01:12.40]海鸟跟鱼相爱\r\n[01:15.58]只是一场意外\r\n[01:19.66]我们的爱\r\n[01:20.31]女:\r\n[01:20.32]给的爱\r\n[01:21.81]合:\r\n[01:22.32]差异一直存在\r\n[01:24.98]女:\r\n[01:25.40]回不来\r\n[01:26.44]男:\r\n[01:26.55]风中尘埃\r\n[01:27.70]合:\r\n[01:28.45]等待竟累积成伤害\r\n[01:32.71]转身离开\r\n[01:35.17]分手说不出来\r\n[01:38.59]蔚蓝的珊瑚海\r\n[01:41.87]错过瞬间苍白\r\n[01:44.80]男:\r\n[01:45.48]当初彼此\r\n[01:46.90]女:\r\n[01:46.90]你我都\r\n[01:47.99]合:\r\n[01:48.53]不够成熟坦白\r\n[01:51.59]女:\r\n[01:51.81]不应该\r\n[01:52.71]男:\r\n[01:52.79]热情不再\r\n[01:54.18]合:\r\n[01:54.44]你的笑容勉强不来\r\n[01:58.30]爱深埋珊瑚海\r\n[02:04.38]男:\r\n[02:06.81]毁坏的沙雕如何重来\r\n[02:13.48]有裂痕的爱怎么重盖\r\n[02:18.97]只是一切结束太快\r\n[02:25.86]你说你无法释怀\r\n[02:31.29]女:\r\n[02:32.86]贝壳里隐藏什么期待\r\n[02:37.23]男:\r\n[02:37.74]等花儿开\r\n[02:38.86]合:\r\n[02:39.88]我们也已经无心再猜\r\n[02:44.50]女:\r\n[02:45.36]面向海风\r\n[02:46.52]男:\r\n[02:46.93]面向海风\r\n[02:48.37]女:\r\n[02:48.48]咸咸的爱\r\n[02:49.96]男:\r\n[02:50.27]咸咸的爱\r\n[02:51.66]合:\r\n[02:51.98]尝不出还有未来\r\n[02:58.00]男:\r\n[02:58.55]转身离开\r\n[03:00.03]女:\r\n[03:00.19]你有话说不出来\r\n[03:02.22]男:\r\n[03:02.22]分手说不出来\r\n[03:03.74]合:\r\n[03:04.10]海鸟跟鱼相爱\r\n[03:07.28]只是一场意外\r\n[03:10.11]男:\r\n[03:11.05]我们的爱\r\n[03:12.54]女:\r\n[03:12.66]给的爱\r\n[03:13.62]合:\r\n[03:14.07]差异一直存在\r\n[03:16.97]女:\r\n[03:17.22]回不来\r\n[03:18.01]男:\r\n[03:18.40]风中尘埃\r\n[03:19.52]女:\r\n[03:19.72]等待\r\n[03:20.49]合:\r\n[03:20.77]竟累积成伤害\r\n[03:24.62]转身离开\r\n[03:27.12]分手说不出来\r\n[03:30.33]蔚蓝的珊瑚海\r\n[03:33.58]错过瞬间苍白\r\n[03:37.45]男:\r\n[03:37.89]当初彼此\r\n[03:39.01]女:\r\n[03:39.01]你我都\r\n[03:39.75]合:\r\n[03:40.24]不够成熟坦白\r\n[03:43.11]女:\r\n[03:43.37]不应该\r\n[03:44.47]男:\r\n[03:44.60]热情不再\r\n[03:45.84]合:\r\n[03:46.08]你的笑容勉强不来\r\n[03:50.10]爱深埋珊瑚海\r\n",
        "author_id": "83769",
        "privilege": 10,
        "privilege2": "1010",
        "play_url": "https://webfs.ali.kugou.com/202307261349/3efc2794da0ecf63ac5a99fd3b657f17/part/0/961457/KGTX/CLTX001/clip_109ae8f573993168efbe63072eb0bfb2.mp3",
        "authors": [
            {
                "author_id": "83769",
                "author_name": "Lara梁心颐",
                "is_publish": "1",
                "sizable_avatar": "http://singerimg.kugou.com/uploadpic/softhead/{size}/20230724/20230724104058967.jpg",
                "e_author_id": "2HPPKDE4E5486",
                "avatar": "http://singerimg.kugou.com/uploadpic/softhead/400/20230724/20230724104058967.jpg"
            },
            {
                "author_id": "3520",
                "author_name": "周杰伦",
                "is_publish": "1",
                "sizable_avatar": "http://singerimg.kugou.com/uploadpic/softhead/{size}/20230510/20230510173043311.jpg",
                "e_author_id": "3E0KCC3671E7",
                "avatar": "http://singerimg.kugou.com/uploadpic/softhead/400/20230510/20230510173043311.jpg"
            }
        ],
        "is_free_part": 1,
        "bitrate": 128,
        "recommend_album_id": 2590774,
        "store_type": "audio",
        "album_audio_id": 64208453,
        "is_publish": 1,
        "e_author_id": "2HPPKDE4E5486",
        "audio_id": "234181155",
        "has_privilege": false,
        "play_backup_url": "https://webfs.hw.kugou.com/202307261349/cd7f9340242fa9232182a7986db792cd/part/0/961457/KGTX/CLTX001/clip_109ae8f573993168efbe63072eb0bfb2.mp3",
        "trans_param": {
            "cpy_level": 1,
            "cpy_grade": 5,
            "qualitymap": {
                "attr0": 2048116
            },
            "classmap": {
                "attr0": 234885128
            },
            "pay_block_tpl": 1,
            "language": "国语",
            "cid": 7217202,
            "cpy_attr0": 15488,
            "hash_multitrack": "5C4C40313844627356EACDCE6655E9EA",
            "hash_offset": {
                "clip_hash": "87501048E4D36BF612098E318A76084C",
                "start_byte": 0,
                "end_ms": 60000,
                "end_byte": 961457,
                "file_type": 0,
                "start_ms": 0,
                "offset_hash": "8076D234A2F944814ADFD1FCF82575BA"
            },
            "musicpack_advance": 1,
            "display": 32,
            "display_rate": 1
        },
        "small_library_song": 1,
        "encode_album_id": "1jj1y4c",
        "encode_album_audio_id": "1287k559",
        "e_video_id": "0df"
    }
}

其中play_url的值就是播放地址。

感觉很棒!可以赞赏支持我哟~

3 打赏

评论 (0)

登录后评论
QQ咨询 邮件咨询 狗哥推荐