源地址:

https://github.com/yanunon/NeteaseCloudMusic/wiki/%E7%BD%91%E6%98%93%E4%BA%91%E9%9F%B3%E4%B9%90API%E5%88%86%E6%9E%90

1. 总览

本文档是通过对网易云音乐Android客户端(1.5.2)的部分功能进行分析得出的

在所有的交互中,均需要在cookie中设置这对键值appver=1.5.2;

2. 搜索

POST http://music.163.com/api/search/get/

参数

s: 搜索词

limit: 返回数量

sub: 意义不明(非必须参数);取值:false

type: 搜索类型;取值意义

  • 1 单曲
  • 10 专辑
  • 100 歌手
  • 1000 歌单
  • 1002 用户

offset: 偏移数量,用于分页

MUSIC_U: 意义不明(非必须参数)

示例

curl -d "s=玫瑰色的你&limit=20&type=1&offset=0" -b "appver=1.5.2;" http://music.163.com/api/search/get/

结果:

{"code": 200, "result": {"songCount": 1, "songs": [{"album": {"status": 1, "copyrightId": 0, "name": "\u795e\u7684\u6e38\u620f", "artist": {"alias": [], "picUrl": null, "id": 0, "name": ""}, "publishTime": 1344528000000, "id": 32311, "size": 10}, "status": 1, "copyrightId": 0, "name": "\u73ab\u7470\u8272\u7684\u4f60", "mvid": 5102, "alias": [], "artists": [{"alias": [], "picUrl": null, "id": 10557, "name": "\u5f20\u60ac"}], "duration": 297927, "id": 326695}]}
}

3. 获取歌手专辑列表

GET http://music.163.com/api/artist/albums/[artist_id]/

其中artist_id用歌手id替换

参数

offset: 偏移数量,用于分页

limit: 返回数量

示例

curl -b "appver=1.5.2;" "http://music.163.com/api/artist/albums/10557?offset=0&limit=3"

结果:

{"hotAlbums": [{"status": 1, "blurPicUrl": "http://p2.music.126.net/mic-HzsY8tNY6DD1eHzdlg==/612427976714915.jpg", "commentThreadId": "R_AL_3_2263047", "description": "", "tags": "", "briefDesc": "", "artist": {"img1v1Url": "http://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg", "name": "\u5f20\u60ac", "briefDesc": "", "albumSize": 8, "img1v1Id": 0, "alias": ["\u7126\u5b89\u6ea5"], "picId": 168225279065170, "picUrl": "http://p1.music.126.net/F7i_-eBbuhpBXodY5U2oTw==/168225279065170.jpg", "id": 10557}, "companyId": 0, "publishTime": 1349366400007, "name": "\u795e\u7684\u6e38\u620f \u5de1\u6f14\u7cbe\u534e\u5b9e\u5f55", "alias": [], "picId": 612427976714915, "copyrightId": 0, "picUrl": "http://p1.music.126.net/mic-HzsY8tNY6DD1eHzdlg==/612427976714915.jpg", "company": "\u7d22\u5c3c\u97f3\u4e50", "songs": null, "type": null, "id": 2263047, "size": 7}, ...], "more": true, "code": 200, "artist": {"img1v1Url": "http://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg", "name": "\u5f20\u60ac", "briefDesc": "", "albumSize": 8, "img1v1Id": 0, "alias": ["\u7126\u5b89\u6ea5"], "picId": 168225279065170, "picUrl": "http://p1.music.126.net/F7i_-eBbuhpBXodY5U2oTw==/168225279065170.jpg", "id": 10557}
}

4. 获取专辑音乐列表

GET http://music.163.com/api/album/[album_id]/

其中album_id用专辑id替换

示例

curl -b "appver=1.5.2;" "http://music.163.com/api/album/32311/"

结果:

{"album": {"alias": ["Games We Play"],"artist": {"albumSize": 8,"alias": ["\u7126\u5b89\u6ea5"],"briefDesc": "","id": 10557,"img1v1Id": 0,"img1v1Url": "http://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","name": "\u5f20\u60ac","picId": 168225279065170,"picUrl": "http://p1.music.126.net/F7i_-eBbuhpBXodY5U2oTw==/168225279065170.jpg"},"blurPicUrl": "http://p1.music.126.net/cdoUJ2yO5LRuJhGeIsRdjQ==/46179488380332.jpg","briefDesc": "","commentThreadId": "R_AL_3_32311","company": "\u7d22\u5c3c\u97f3\u4e50\u5a31\u4e50","companyId": 0,"copyrightId": 0,"description": "2012...\n\n","id": 32311,"info": {"commentCount": 1,"comments": null,"latestLikedUsers": null,"liked": false,"likedCount": 0,"shareCount": 2,"threadId": "R_AL_3_32311"},"name": "\u795e\u7684\u6e38\u620f","picId": 46179488380332,"picUrl": "http://p1.music.126.net/cdoUJ2yO5LRuJhGeIsRdjQ==/46179488380332.jpg","publishTime": 1344528000000,"size": 10,"songs": [{"album": {"alias": ["Games We Play"],"artist": {"albumSize": 0,"alias": [],"briefDesc": "","id": 0,"img1v1Id": 0,"img1v1Url": "http://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","name": "","picId": 0,"picUrl": ""},"blurPicUrl": "http://p1.music.126.net/cdoUJ2yO5LRuJhGeIsRdjQ==/46179488380332.jpg","briefDesc": "","commentThreadId": "R_AL_3_32311","company": "\u7d22\u5c3c\u97f3\u4e50\u5a31\u4e50","companyId": 0,"copyrightId": 0,"description": "","id": 32311,"name": "\u795e\u7684\u6e38\u620f","picId": 46179488380332,"picUrl": "http://p1.music.126.net/cdoUJ2yO5LRuJhGeIsRdjQ==/46179488380332.jpg","publishTime": 1344528000000,"size": 10,"songs": null,"status": 1,"tags": "","type": ""},"alias": [],"artists": [{"albumSize": 0,"alias": [],"briefDesc": "","id": 10557,"img1v1Id": 0,"img1v1Url": "http://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","name": "\u5f20\u60ac","picId": 0,"picUrl": ""}],"bMusic": {"bitrate": 320000,"dfsId": 1012650209189891,"id": 10334056,"name": "\u73ab\u7470\u8272\u7684\u4f60","playTime": 297927,"size": 11930240},"commentThreadId": "R_SO_4_326695","copyrightId": 0,"dayPlays": 0,"duration": 297927,"hMusic": {"bitrate": 320000,"dfsId": 1012650209189888,"id": 10334053,"name": "\u73ab\u7470\u8272\u7684\u4f60","playTime": 297927,"size": 11930240},"hearTime": 0,"id": 326695,"lMusic": {"bitrate": 96000,"dfsId": 1012650209189890,"id": 10334055,"name": "\u73ab\u7470\u8272\u7684\u4f60","playTime": 297927,"size": 3595194},"mMusic": {"bitrate": 160000,"dfsId": 1012650209189889,"id": 10334054,"name": "\u73ab\u7470\u8272\u7684\u4f60","playTime": 297927,"size": 5976935},"mp3Url": "http://m1.music.126.net/uCNvR9xHLoQIj1kIRyzadQ==/1012650209189889.mp3","mvid": 5102,"name": "\u73ab\u7470\u8272\u7684\u4f60","playedNum": 0,"popularity": 95.0,"position": 1,"score": 95,"starred": false,"starredNum": 0,"status": 1},...],"status": 1,"tags": "","type": ""},"code": 200
}

5. 下载音乐文件

GET http://m1.music.126.net/[encrypted_song_id]/[song_dfsId].mp3

其中song_dfsId为歌曲id,同一歌曲不同比特率有不同的id,见上结果。encrypted_song_idsong_dfsId加密后的字符串。

歌曲id加密代码

import md5def encrypted_id(id):byte1 = bytearray('3go8&$8*3*3h0k(2)2')byte2 = bytearray(id)byte1_len = len(byte1)for i in xrange(len(byte2)):byte2[i] = byte2[i]^byte1[i%byte1_len]m = md5.new()m.update(byte2)result = m.digest().encode('base64')[:-1]result = result.replace('/', '_')result = result.replace('+', '-')return result

[转]网易云音乐API分析相关推荐

  1. 网易云音乐API分析

    环境:Win10 工具:Fiddler 4,Chrome浏览器 想做一个网易云音乐的下载地址解析,于是有了这篇文章,记录下过程. 开Fiddler截包 抓取到如下的包 POST http://musi ...

  2. 小谈网易云音乐----API

    网易云音乐API分析1. 总览本文档是通过对网易云音乐Android客户端(1.5.2)的部分功能进行分析得出的在所有的交互中,均需要在cookie中添加这对键值appver=1.5.2;(Updat ...

  3. 开源的网易云音乐API项目都是怎么实现的?

    上一篇文章这个高颜值的开源第三方网易云音乐播放器你值得拥有介绍了一个开源的第三方网易云音乐播放器,这篇文章我们来详细了解一下其中使用到的网易云音乐api项目NeteaseCloudMusicApi的实 ...

  4. 网易云音乐api歌单数据获取

    网易云音乐api歌单数据获取 网易作为IT大厂,数据可以说 藏的很严实,普通按个f12以为能搞到点东西,结果,看不到要的歌单信息,这可是愁死我了啊. 后来看了看知乎,一帮怪才集中的地方果然迸发了思维的 ...

  5. 网易云音乐API使用

    网易云音乐API使用 网易云音乐API 1.安装 $ git clone git@github.com:Binaryify/NeteaseCloudMusicApi.git 或者 https://gi ...

  6. 网易云音乐API,的调用方法 ,vue项目中(在本地使用)

    1. 在cmd 命令行下:安装并启动: git clone https://github.com/Binaryify/NeteaseCloudMusicApi.git /* 下载 */cd Netea ...

  7. 网易云音乐API使用教程与遇到的问题

    网易云音乐API 简单又好用. 其实他那里面讲是很清楚了,有些地方小白不会,我帮他讲一下 1.在你的项目下 git clone git@github.com:Binaryify/NeteaseClou ...

  8. Github每日Rank推荐:网易云音乐API

    今天要推荐的github开源项目是NeteaseCloudMusicApi,即网易云音乐API,安装所需环境即可实现真实调用网易云音乐 API,包括注册.登录.搜索歌单歌词.歌曲点评等功能,请看客老爷 ...

  9. Github项目推荐:网易云音乐 API

    网易云音乐 API Github项目地址:https://github.com/Binaryify/NeteaseCloudMusicApi Github文档地址:https://binaryify. ...

最新文章

  1. Spring入门第五课
  2. java servlet jsp javabean关系图_Servlet+JSP+JavaBean开发模式(MVC)介绍
  3. 【英语学习】【加州教材】【G6】【科学】Earth Science目录及术语表
  4. NVMe驱动学习记录-2
  5. 医院药品管理系统源码 HIS系统源码
  6. BZOJ2827 - 千山鸟飞绝
  7. 十年MFC经历认识的Microsoft技术
  8. excel 数组公式
  9. R语言学习笔记(二)——回归分析
  10. 生活点滴记录-- 两点一线
  11. IDEA中maven项目的language level 修改后自动重置问题
  12. WPS如何将金额快速改为万元显示
  13. [iOS UI设计笔记整理汇总]
  14. Spring boot快速开发Rest服务
  15. word怎么删除空白页,Word Mac删除空白页面的图文方法
  16. win10英雄联盟登陆服务器未响应怎么办,Win10系统中登陆LOL失败怎么办
  17. 金蝶EAS linux 客户端,金蝶eas客户端
  18. 企业上云进程加速,云计算或将迎来发展黄金期
  19. android之壁纸相关
  20. 软件测试30K*16(总包50W+)入职offer,一位字节跳动女测试开发的自述

热门文章

  1. 企业不得不知的BYOD实施十大风险
  2. 有些事,明明你早早就知道,但你不能说
  3. [软件人生]从应聘到骂人
  4. 虽然996很苦逼,但也要快乐地活着嘛
  5. Android平台证件识别系统
  6. 阿里云轻量应用服务器环境搭建-设置通过密钥登录服务器
  7. Linux yum命令
  8. 当当吃海货,不算不会过
  9. 常见LED灯的颜色波长及应用
  10. C++中cout的使用