NeteaseCloudMusic APIs for Python 3.x 适用于 Python 3 的网易云音乐 API
Project description
PyNCM
NeteaseCloudMusic APIs for Python 3.6+ 适用于 Python 3.6+ 的网易云音乐 API
安装
pip install pyncm
直接使用
API 可以通过命令行直接访问,请参照下列命令输出进行操作 python -m pyncm -h
命令行使用说明
配置
pyncm config
可以将输入的参数存储在 ~/.pyncm 中,一劳永逸 python -m pyncm config --phone [your phone number] --password [your password] --output Downloads --clear-temp --quality lossless --logging-level 30- 解释
--phone --password
登录令牌;将会以 cookie 的形式被保存--output
输出文件夹--clear-temp
自动清除下载临时文件--quality
下载质量--logging-level
日志过滤等级 - 优先级: 若在使用中设置了其他参数,命令行的参数会作为该会话的设置
- 解释
使用
下载歌曲
pyncm song --id [歌曲 ID]
下载歌单
pyncm playlist --id [歌单 ID]
下载专辑
pyncm album --id [专辑 ID]
关于 ID
可通过网易云音乐的“分享链接”功能取得
如 https://music.163.com/playlist?id=3199245372&userid=315542615
,该ID即为3199245372
其他功能详见 Wiki
Python 使用示例
from pyncm import apis
# 获取歌曲信息
apis.track.GetTrackAudio(29732235)
`{'data': [{'id': 29732235, 'url': 'http://m701.music.126.net/20200313090222/479f50d5748625d59d405c7a219f3f5b/jdyyaac/040f/565c ...`
# 获取歌曲详情
apis.track.GetTrackDetail(29732235)
`{'songs': [{'name': 'Supernova', 'id': 29732235, 'pst': 0, 't': 0, 'ar': [{'id': 38725, 'name': 'Laszlo', 'tns': [], ...`
# 获取歌曲评论
apis.track.GetTrackComments(29732235)
`{'isMusician': False, 'userId': -1, 'topComments': [], 'moreHot': True, 'hotComments': [{'user': {'locationInfo': None, 'liveIn ...`
详见 Wiki (WIP) 或自翻代码😶
Credit
decompilation of libposion.so
Binaryify/NeteaseCloudMusicApi
PR
本项目(截至 2020/08/24)已补全网易云所用加密算法,欢迎各位提交 PR ,补全API
衍生项目
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyncm-1.3.1.tar.gz
(25.5 kB
view details)
Built Distribution
pyncm-1.3.1-py3-none-any.whl
(92.3 kB
view details)
File details
Details for the file pyncm-1.3.1.tar.gz
.
File metadata
- Download URL: pyncm-1.3.1.tar.gz
- Upload date:
- Size: 25.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfc636e74aa510fcafd6f7b157ebdc6b3da650cb0dbc643c7b05a4b2932b5f5b |
|
MD5 | d46d76aa2f015ae5b5ceb0b83bd2ebed |
|
BLAKE2b-256 | 79db0dc727b846e0163a9c8835ab5d5e321d00ad2c6a6c807e01c89bb5b44990 |
File details
Details for the file pyncm-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: pyncm-1.3.1-py3-none-any.whl
- Upload date:
- Size: 92.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6945e187bb897791642ec639acf801d5a5019489cd5e108679e1ec2885fddc41 |
|
MD5 | 81a8f6727d3c9dee2dfaa8f13d306aa7 |
|
BLAKE2b-256 | 472e0050c2740f635cee2e25b639c3e6c510f11206bf5845938124ffa37cdda0 |