English | 中文
Get the media through the url, and provide proxy setting, for different sources can set different proxy address
# download the bilibili video with the url
media-get -u "https://www.bilibili.com/video/BV1eb4y187AG?spm_id_from=444.41.0.0"
# only download the audio, use `-t audio`
media-get -u "https://www.bilibili.com/video/BV1eb4y187AG?spm_id_from=444.41.0.0" -t audio
The program would list the result sorted by keyword related, then you can download with the url
# With the keyword, such as "songName artistName"
media-get -k "搁浅 周杰伦"
# The result will be sorted more accurate if specific these info
media-get --searchSongName="搁浅" --searchArtist="周杰伦"
media-get --searchSongName="搁浅" --searchArtist="周杰伦" --searchAlbum="七里香"
# Just want to search in some source
media-get -k "搁浅 周杰伦" --sources="migu,bilibili"
# Search in all source but some source
media-get -k "搁浅 周杰伦" --excludeSource="youtube"
The proxy is set in the form of environment variables or json files, with priority environment variables > configuration files.
You only need to set the ENV_MEDIA_GET environment variable to take effect, the environment variable is also in json format
{
"proxy":{
"douyin":"http://a.com",
"bilibili":"http://b.com"
}
}
You need to create a file named .media-get.json in the HOME directory of the current login, with the same contents as the environment variables set above, also a json format configuration
The program support output info with JSON. You can search with keyword then filter the result you wanna. After that, call the program with the url to download media file
BTW, my another open source project Personal Music Assistant , will use the program to do awesome thing.
media-get --searchSongName="그리움에 가까운" --searchArtist="Hello Gayoung" --infoFormat=json
One of the following way can be downloaded
- from the latest release page. Click me
- brew install (coming soon...)
Require ffmpeg
, please install it before use the tool.
- From official website: https://www.ffmpeg.org/download.html
- Mac:
brew install ffmpeg
Usage:
main [OPTIONS]
Application Options:
-u, --url= Url from website. Start with http[s]://
-o, --out= The output file will be place to here(dir/filename). Default: current dir
-t, --type= The resource type you want to get [auto/audio/video/all] (default: auto)
-m, --metaOnly Output meta info only. Would not download audio
--infoFormat= Support plain/json. Default: plain
--addMediaTag Add media tag into file from meta information
-l, --logLevel= Support: silence/error/warn/info/debug. Default: info
Search Options:
-k, --keyword= If search song, keyword or searchSongName is required. Would use keyword to search if both of them are specify. Such as "songName singer"
--searchSongName= song name
--searchArtist= artist name
--searchAlbum= album name
--searchType= Support: song, Default: song
--sources= Search in the specific source, separate with comma. Support: bilibili,douyin,kugou,kuwo,migu,netease,qq,youtube,qmkg. Default search in all
--excludeSource= Search not in the specific source, separate with comma
Help Options:
-h, --help Show this help message
make build
Site | Source Name | Audio | Video | Search |
---|---|---|---|---|
bilibili | bilibili | ✅ | ✅ | ✅ |
youtube | youtube | ✅ | ✅ | ✅ |
netease | netease | ✅ | ✅ | ✅ |
qq music | ✅ | ⌛ | ✅ | |
douyin | douyin | ✅ | ✅ | ✅ |
migu music | migu | ✅ | ⌛ | ✅ |
kugou | kugou | ✅ | ⌛ | ✅ |
kuwo | kuwo | ✅ | ⌛ | ✅ |
qmkg | qmkg | ✅ | ⌛ | ⌛ |
- DouYin XB: https://www.jianshu.com/p/4db4f4d6a536
- Netease Encrypt Method: https://github.com/872409/music-get