Skip to main content

NeteaseCloudMusic_PythonSDK

基于 NeteaseCloudMusicApi 封装的 Python SDK。 网易云API Python版本。 现已同步原项目接口且测试通过的有200多个 已发布到PyPi,可直接使用pip安装 项目地址:GitHub

License

依赖于

原理

  • 通过 py_mini_racer 调用 NeteaseCloudMusicApi_V8js 方法。进一步进行了简单封装。

使用

  • 安装 pip install NeteaseCloudMusic
  • 导入API进行使用(具体查看test.py中的示例)
from NeteaseCloudMusic import NeteaseCloudMusicApi, api_help, api_list
import os

netease_cloud_music_api = NeteaseCloudMusicApi()  # 初始化API
netease_cloud_music_api.cookie = os.getenv("COOKIE")  # 设置cookie
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/v1song_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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NeteaseCloudMusicApi-0.1.2.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

NeteaseCloudMusicApi-0.1.2-py2.py3-none-any.whl (1.3 MB view details)

Uploaded Python 2Python 3

File details

Details for the file NeteaseCloudMusicApi-0.1.2.tar.gz.

File metadata

  • Download URL: NeteaseCloudMusicApi-0.1.2.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for NeteaseCloudMusicApi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3b59e68fce10926b88aea2e79a32d209e7ad072120e62f4942aeae36758fa186
MD5 d28d7d1663287876c5887fa5eca9d68d
BLAKE2b-256 953d90bf62fd476144b2a5679bfe9e7b3f66cb85b36f85ac6f85200a4e86ef35

See more details on using hashes here.

File details

Details for the file NeteaseCloudMusicApi-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for NeteaseCloudMusicApi-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9cd4778cbfceba1e054abbe645f43e7e59ac8ba7b7564e51f596bdc388733b3a
MD5 cb041163dd380dacdab8647b09cfb26f
BLAKE2b-256 e1130c94fcae8a3253bf593bf26dd02516d22f2e52884959a623f93fd782917a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page