Download the required music through Python-based Pymusic-dl

Preface

Recently, I started to study and make videos. It is necessary to download the required music from the music player. Because it is a work computer, it is troublesome to install the player. Many websites provide downloads that require payment.

Then find a music download tool Music-dl, a command line tool based on Python3 , which can be used under Macos/Linux/Windows. You can search and download music from multiple websites to easily find music. It supports QQ Music, NetEase Cloud Music, Xiami Music, Kugou Music and Baidu Music, but you cannot get paid songs.

Don't say much, just open up.

Install using pip

pip3 install pymusic-dl

Insert picture description here

If the pip version is too low during the installation process, please follow the prompts to upgrade

Insert picture description here

Install from the latest source code

git clone https://github.com/0xHJK/music-dl.git
cd music-dl
python3 setup.py install

Run directly without installation

The test is normal under DeepinV20

git clone https://github.com/0xHJK/music-dl.git
cd music-dl
pip3 install -r requirements.txt
python3 ./music-dl

Instructions

Input music-dl --helpView Description

Usage: music-dl [OPTIONS]
  Search and download music from netease, qq, kugou, baidu and
  xiami. Example: music-dl -k "周杰伦"

Options:
  --version             Show the version and exit.
  -k, --keyword TEXT    搜索关键字,歌名和歌手同时输入可以提高匹配(如 空帆船 朴树)
  -u, --url TEXT        通过指定的歌曲URL下载音乐
  -p, --playlist TEXT   通过指定的歌单URL下载音乐
  -s, --source TEXT     支持的数据源: baidu
  -n, --number INTEGER  搜索数量限制
  -o, --outdir TEXT     指定输出目录
  -x, --proxy TEXT      指定代理(如http://127.0.0.1:1087)
  -v, --verbose         详细模式
  --lyrics              同时下载歌词
  --cover               同时下载封面
  --nomerge             不对搜索结果列表排序和去重
  --help                Show this message and exit.

download music

music-dl -k "关键字/音乐名/歌手"

For example, I want to search for background music , to search the contents of 15, enter the serial number you need to download files to download

Insert picture description here
After I enter 0-10, it will download automatically, and the paid concert reports an error that the download failed

Insert picture description here
Music files are downloaded to the current directory, we find C:\Usersthe directory you can see the contents of the download

But I don’t know what the situation is, my download file is always 1k, and the test is normal under DeepinV20

Guess you like

Origin blog.csdn.net/no1xium/article/details/108532418