Skip to main content

Netease cloud music song downloader, with full ID3 metadata!

Project description

netease-cloud-music-dl (ncm)

Forked from codezjx/netease-cloud-music-dl.

Difference from the original (Extra features)

  • Uploaded to PyPI, can be installed directly via pipx or pip, without the need to clone first
  • The -s, -ss options fall back to parsing songs with /song/<song_id> in the URL path, if the id query param is not found.

Installation

pipx

This is the recommended installation method.

$ pipx install netease-cloud-music-dl-tddschn

pip

$ pip install netease-cloud-music-dl-tddschn

Develop

$ git clone https://github.com/tddschn/netease-cloud-music-dl.git
$ cd netease-cloud-music-dl
$ poetry install

网易云音乐下载器

基于Python3.X编写的网易云音乐命令行下载器,自动下载专辑封面,记录歌手名、音乐标题、专辑名等元数据,并写入ID3 Tags metadata容器。在github上试了几个高星的下载器都没有写入专辑封面,对于强迫症患者简直不能忍,于是一怒之下决定自己写。

Preview

Preview

Installation

若没有安装Python3,请先到官网下载并安装:

https://www.python.org/download/releases/3.0/

首先下载源码:

$ git clone https://github.com/codezjx/netease-cloud-music-dl.git

进入根目录,然后执行:

$ python3 setup.py install

最终显示以下log,表示顺利安装:

running install
running bdist_egg
running egg_info
...
...
Finished processing dependencies for netease-cloud-music-dl==x.x.x

后续直接在命令行中通过ncm指令即可快速调用相关功能,Warning: 目前只支持Python3.x版本

Feature

  • 支持下载专辑封面并嵌入MP3文件
  • 支持写入歌手名、音乐标题、专辑名等信息至ID3 Tags
  • 支持跳过已下载的音频文件
  • 支持常见设置选项,如:保存路径、音乐命名格式、文件智能分类等
  • 默认下载比特率为320k的高品质音乐(若木有320k则会自动下载最高比特率)
  • 支持下载单首/多首歌曲
  • 支持下载歌手热门单曲(可配置最大下载数)
  • 支持下载专辑所有歌曲
  • 支持下载公开歌单所有歌曲

(注意:已下架的音乐暂时无法下载)

通过ncm -h即可查看所支持的参数列表:

$ ncm -h
usage: ncm [-h] [-s song_id] [-ss song_ids [song_ids ...]] [-hot artist_id]
           [-a album_id] [-p playlist_id]

optional arguments:
  -h, --help            show this help message and exit
  -s song_id            Download a song by song_id
  -ss song_ids [song_ids ...]
                        Download a song list, song_id split by space
  -hot artist_id        Download an artist hot 50 songs by artist_id
  -a album_id           Download an album all songs by album_id
  -p playlist_id        Download a playlist all songs by playlist_id

Usage

下载单曲

使用参数-s,后加歌曲id或者歌曲完整url,如:

$ ncm -s 123123
or
$ ncm -s http://music.163.com/#/song?id=123123

下载多首歌曲

使用参数-ss,后加歌曲ids或者歌曲完整urls(id或url之间通过空格隔开),如:

$ ncm -ss 123123 456456 789789
or
$ ncm -ss url1 url2 url3

下载某歌手的热门单曲(默认下50首,可配置)

使用参数-hot,后加歌手id或者完整url,如:

$ ncm -hot 123123
or
$ ncm -hot http://music.163.com/#/artist?id=123123

下载某张专辑的所有歌曲

使用参数-a,后加专辑id或者完整url,使用方法同上。

下载某个公开的歌单

使用参数-p,后加歌单id或者完整url,使用方法同上,必须确认是公开的歌单才能下载哦。

Settings

配置文件在在用户目录下自动生成,路径如下:

/Users/yourUserName/.ncm/ncm.ini

目前支持以下几项设置:

[settings]

#--------------------------------------
# 热门音乐的最大下载数,默认50
# Range: 0 < hot_max <= 50
#--------------------------------------
download.hot_max = 50

#--------------------------------------
# 音乐文件的下载路径,默认在用户目录.ncm/download目录下
#--------------------------------------
download.dir = /Users/yourUserName/.ncm/download

#--------------------------------------
# 音乐命名格式,默认1
# 1: 歌曲名
# 2: 歌手 - 歌曲名
# 3: 歌曲名 - 歌手
#--------------------------------------
song.name_type = 1

#--------------------------------------
# 文件智能分类,默认1
# 1: 不分文件夹
# 2: 按歌手分文件夹
# 3: 按歌手/专辑分文件夹
#--------------------------------------
song.folder_type = 1

Warning: 智能分类设置目前只针对-s-ss参数有效,-hot/-a/-p分别会存于后缀为:-hot50/-album/-playlist的文件夹中,方便管理本地音乐。

Feedback

如果遇到Bugs,欢迎提issue或者PR,谢谢各位支持~

License

MIT License

Copyright (c) 2017 codezjx code.zjx@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

netease-cloud-music-dl-tddschn-0.3.1.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file netease-cloud-music-dl-tddschn-0.3.1.tar.gz.

File metadata

File hashes

Hashes for netease-cloud-music-dl-tddschn-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f74795e6b572f2f5dee862227a36039b27e0ac7cbef3cafaa1cd02b0ca51f966
MD5 4124bd601cd62ebd1547f8bd47691c2a
BLAKE2b-256 b663585312bd7dc127b3628a660cc05be291371391d05b35a6702d2a804a05cc

See more details on using hashes here.

File details

Details for the file netease_cloud_music_dl_tddschn-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for netease_cloud_music_dl_tddschn-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 79cd4e697db6ee23be805f756f1bf07ad98c4bde58c11c0b512f4c313947eabe
MD5 27b8db40924ac9a67a381d4661980013
BLAKE2b-256 14c9faf37ef9af0d2d649d9873b2b59d6161703488ae472ccf5392284fdc2d98

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page