网易云音乐API NeteaseCloudMusicApi项目的 Python SDK
Project description
NeteaseCloudMusic_PythonSDK
基于 NeteaseCloudMusicApi 封装的 Python SDK。 网易云API Python版本。 现已同步原项目接口且测试通过的有200多个 已发布到PyPi,可直接使用pip安装 项目地址:GitHub
依赖于
原理
- 通过
py_mini_racer
调用NeteaseCloudMusicApi_V8
的js
方法。进一步进行了简单封装。
使用
- 安装
pip install NeteaseCloudMusic
- 导入API进行使用(具体查看
example.py
中的示例)
from NeteaseCloudMusic import NeteaseCloudMusicApi, api_help, api_list
import os
netease_cloud_music_api = NeteaseCloudMusicApi() # 初始化API
netease_cloud_music_api.cookie = "你的cookie" # 设置cookie, 如果没有cookie需要先登录 具体见example.py
response = netease_cloud_music_api.request("song_url_v1", {"id": 33894312, "level": "exhigh"}) # 调用API
# 获取帮助
print(api_help())
print(api_help('song_url_v1'))
# 获取API列表
print(api_list())
注意: request(self, name, query=None) 的第一个参数为API名称,第二个参数为API参数,具体API名称和参数请参考 NeteaseCloudMusicApi文档,name支持
/song/url/v1
和song_url_v1
两种写法。
开发
- 克隆项目
git clone git@github.com:2061360308/NeteaseCloudMusic_PythonSDK.git
- 安装依赖
pip install -r requirements.txt
- 目录/文件说明 ├── package 项目包根目录 ├── test_gender 生成测试代码的脚本 ├── test.py 手动测试/ 使用示例
改进
下列API未支持
- apicache.js
- memory-cache.js
- request_reference.js
- avatar_upload.js
- cloud.js
- playlist_cover_update.js
- voice_upload.js
- register_anonimous.js
- verify_getQr.js
以下api未测试(这些接口测试起来比较繁琐)
- /user/replacephone
- /audio/match
- /rebind
- /nickname/check
- /activate/init/profile
- /cellphone/existence/check
- /register/cellphone
- /captcha/verify
- /captcha/sent
- /login/refresh
- /logout
- /user/update
- /pl/count
- /playlist/update
- /playlist/desc/update
- /playlist/name/update
- /playlist/tags/update
- /event/forward
- /event/del
- /share/resource
- /send/text
- /send/playlist
- /playlist/create
- /playlist/tracks
- /daily_signin
- /fm_trash
欢迎提交PR
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
NeteaseCloudMusic-0.1.6.tar.gz
(18.9 kB
view details)
Built Distribution
File details
Details for the file NeteaseCloudMusic-0.1.6.tar.gz
.
File metadata
- Download URL: NeteaseCloudMusic-0.1.6.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab4b8ce4171af77bff65849225bf47e85136d431f48003bf60d2d0c53f2e30ef |
|
MD5 | 4186d16c9c9c959de3c5242a91bc6d90 |
|
BLAKE2b-256 | edc40a4fa70369db071e9fc5b43d32757038bde5c5b82386fa6ee208a9dce574 |
File details
Details for the file NeteaseCloudMusic-0.1.6-py2.py3-none-any.whl
.
File metadata
- Download URL: NeteaseCloudMusic-0.1.6-py2.py3-none-any.whl
- Upload date:
- Size: 291.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fce835d1112648005f3cc856fb631c657c8b93d06071588eb5099bb4322e0f1d |
|
MD5 | 53df722bd2e0faf3d33eedcc0c358ee7 |
|
BLAKE2b-256 | 45584c413cea67173655e5e21c3e84e3227493d7fe99051d653f71dd5a1aff3d |