基于命令行的网易云音乐下载器netease-dl

引言

一个基于命令行的网易云音乐下载器,项目的GitHub地址=>https://github.com/ziwenxie/n...

安装

Git clone最新版

$ git clone https://github.com/ziwenxie/netease-dl
$ python3 setup.py install

PyPi安装

$ pip3 install netease-dl

p.s: 仅支持Python3.x。

功能特性

通过--help可以查看到所有的功能特性,包括下载单首歌曲,下载一张唱片的所有歌曲,下载一个歌手的前50首热门歌曲,下载一张歌单的所有歌曲,下载一个用户的公开歌单以及登录后可下载个人的私人歌单。

$ netease-dl --help
Usage: netease-dl [OPTIONS] COMMAND [ARGS]...

  A command tool to download NetEase-Music's songs.

Options:
  -t, --timeout INTEGER  Time to wait before giving up, in seconds.
  -p, --proxy TEXT       Use the specified HTTP/HTTPS/SOCKS proxy.
  -o, --output PATH      Specify the storage path.
  -q, --quiet            Automatically select the best one.
  -l, --lyric            Download lyric.
  -a, --again            Login Again.
  --help                 Show this message and exit.

Commands:
  album     Download a album's songs by name or id.
  artist    Download a artist's hot songs by name or id.
  me        Download my playlists.
  playlist  Download a playlist's songs by id.
  song      Download a song by name or id.
  user      Download a user's playlists by id.

使用

下载单首歌曲

使用song命令,在后面通过--name或者-n选项来指定歌曲的名字:

$ netease-dl song --name 歌曲名

上面会返回10条搜索结果,可以在song命令前面加一个--quietnetease-dl会自动匹配第一个返回的结果:

$ netease-dl --quiet song --name 歌曲名

如果知道歌曲id的话,也可以直接使用--id或者-i选项来指定:

$ netease-dl song --id 歌曲id

netease-dl的所有子命令所支持的特性都可以通过在子命令后面加一个--help选项来查看:

$ netease-dl song --help
Usage: netease-dl song [OPTIONS]

  Download a song by name or id.

Options:
  -n, --name TEXT   Song name.
  -i, --id INTEGER  Song id.
  --help            Show this message and exit.

下载一个歌手的50首热门歌曲

使用artist命令,并且在后面通过--name或者-n选项来指定歌手的姓名:

$ netease-dl artist --name 歌手名

和上面下载歌曲的时候一样,也可以使用--quiet--id,下面也是一样的原理,接下来我就不重复了。

下载一张唱片的所有歌曲

使用album命令,后面接--name或者-n选项来指定唱片的名字:

$ netease-dl album --name 唱片名

下载一张歌单的所有歌曲

使用playlist命令,后面接--name或者-n选项来指定歌单的名字:

$ netease-dl playlist --name 歌单名

下载指定用户的公开歌单

使用user命令,后面接--name或者-n选项来指定用户的名字:

$ netease-dl user --name 用户名

下载个人收藏以及创建的歌单

使用me命令登录之后可以下载自己的所有歌单包括私人的歌单,以后一段之间之内如果没有修改过密码就不需要重新登录了:

$ netease-dl me

如果要换一个帐号或者登录密码修改了,使用--again或者-a选项重新登录:

$ netease-dl --again me

更多选项

除了上面提到的--quiet选项,正如使用netease-dl --help选项看到的,netease-dl还支持设置代理,设置超时时间,指定下载目录,是否下载歌词等选项,这些都可以通过在子命令前面加上相关的选项来指定。

将歌曲下载到指定路径

使用--output或者-o选项指定下载路径:

$ netease-dl -o 路径名 artist -n 歌手名

设置代理

海外用户可能要设置相关的代理,netease-dl同时支持http和socks协议代理,可以通过--proxy或者-p选项指定,注意要声明代理所使用的协议:

$ netease-dl -p 'http://127.0.0.1:8118' artist -n 歌手名
$ netease-dl -p 'socks5://127.0.0.1:1080' artist -n 歌手名

更新日志

2017-03-19 1.0.2 fix song may contains special character and won't download again if song exists(#2, #3)

2017-03-16 1.0.1 fix dependencies problem(#1)

NetEase-MusicBox,高品质网易云音乐命令行版本,简洁优雅,丝般顺滑,基于Python编写。功能特性320kps的高品质音乐 歌曲,艺术家,专辑检索网易热门歌曲排行榜网易新碟推荐网易精选歌单网易DJ节目私人歌单 随心打碟本地收藏(不提供下载)精心设计的快捷键让操作丝般顺滑键盘快捷键                J                Down                下移                K                Up                上移                H                Back                后退                L                Forword                前进                U                Prev page                上一页                D                Next page                下一页                F                Search                快速搜索                [                Prev song                上一曲                ]                Next song                下一曲                Space                Play/Pause                播放/暂停                M                Menu                主菜单                P                Present                当前播放列表                A                Add                添加曲目到打碟                Z                DJ list                打碟列表                S                Star                添加到收藏                C                Collection                收藏列表                R                Remove                删除当前条目                Q                Quit                退出安装$ pip install netease-musicbox $ brew install mpg123使用$ musicbox    Enjoy it ! 标签:NetEase
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值