Skip to main content

NeteaseCloudMusic_PythonSDK

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

License

依赖于

原理

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

使用

  • 安装 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/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

Metadata

Release files for NeteaseCloudMusicApi 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for NeteaseCloudMusicApi 0.1.2
File Size Uploaded Provenance
NeteaseCloudMusicApi-0.1.2.tar.gz 1.3 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for NeteaseCloudMusicApi 0.1.2
File Interpreter ABI Platform
NeteaseCloudMusicApi-0.1.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 2.6 MB

Release files / NeteaseCloudMusicApi-0.1.2.tar.gz

Download URL NeteaseCloudMusicApi-0.1.2.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
3b59e68fce10926b88aea2e79a32d209e7ad072120e62f4942aeae36758fa186
BLAKE2b-256 checksum
How to use checksums
953d90bf62fd476144b2a5679bfe9e7b3f66cb85b36f85ac6f85200a4e86ef35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / NeteaseCloudMusicApi-0.1.2-py2.py3-none-any.whl

Download URL NeteaseCloudMusicApi-0.1.2-py2.py3-none-any.whl
Size 1.3 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
9cd4778cbfceba1e054abbe645f43e7e59ac8ba7b7564e51f596bdc388733b3a
BLAKE2b-256 checksum
How to use checksums
e1130c94fcae8a3253bf593bf26dd02516d22f2e52884959a623f93fd782917a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for NeteaseCloudMusicApi 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page