命令行版音乐播放器已就位,你值得拥有

Somusic

project github: https://github.com/jaydenwen123/Somusic

This is the command line music downloader,which contains lots of functions such as search song and mv from kugou website、download song and mv with single or batch.、list search songs or mvs、show download songs or mvs .Above functions have matching commands.You can use help or h to find doc.Finally there left a function that is play music and play mv.I will complete this function in the near future.

Who Should See This Project?

  • If you want to learn golang quickly with a practical project;
  • If you want to get a better understand about how the command line software is runned;
  • If you want to enter the Network Spider World quickly;
  • If you are interested in the music website,and you want to build yourself music player;
  • this project is absolutely nice for you.

What Can You Get?

  1. Spider the Kugou Music Website by Golang language.
  2. Concurrnet download the file(including not only mp3 file and mp4 file,but also binary files and text files.) by Golang goroutine and Channel.
  3. Master skills of JSON and Golang struct、 interface、http、regexp and Golang basic knowledge.
  4. Practice to use the famous librarys such as:goquery、gjson...
  5. Understand how the command line tool is working. Such as windows cmd、Golang Web Framework beego's bee tool.
  6. Analysis the Http's Interface about Kugou Music Website.
  7. Get the skill of Spider by Golang.

Getting Started

Installing

  1. create a directory which is used to store the project.for example: cd d:\golang\workspace\.
  2. you should execute this command git clone https://github.com/jaydenwen123/Somusic.git
  3. if you want to move this project into %gopath%,then you can move it to your gopath's src directory.

Now this will retrieve the project to your local directory, you can start your travel.

Help Document

1.the somusic support many functions which also can match with it's command. there are all supported functions listed in the table.

CommandParameterFunctionDescription
gboardno paramterdownload rank boarddownload the kugou rank board all song
lsong[max songid] or list searched songsshow the asc range musics list(note:the shown songs is not downloaded)
lmv[max mvid] or list searched mvsshow the asc range mv list,it's also like lsong.
gsong[songid] or <first1-end1,first2-end2...> or <songid1,...,first1-end1,songid2,songid3...>get or download songs from remote serverdownload one music or download according the range.it support download single song、batch(first-end) songs 、 discontinuous(songid1,songid5,songid8,...) songs and mixed above all ways
gmv[mvid] or <first1-end1,first2-end2...> or <mvid1,...,first1-end1,mvid5,mvid7...>download mv files with many waysgmv usage is also familiar with gsong.you can also see gsong's usage
psong[songid]play the selected songthis function is just not completed.it will fill in the near future
pmv[mvid]play the selected mvthis function is just not completed.it will fill in the near future
qsong[keyword]query songquery song with the inputed keyword from the kugou music website
qmv[keyword]query songquery mv with the inputed keyword from the kugou music website
ssongno paramtershow all downloaded local songsshow the downloaded songs list,the songid you can use to play song in the list
smvno paramtershow all downloaded local mvsthis comamnd's usage is similiar to the ssong.you can also see ssong.
chstyle[new style string]change the stylechange the style with the new style string.this's command is same to the command style.
style[new style string]change the stylechange the style with new style string.
chdelimiter[new delimiter chars]change the delimiter charsit will change the old delimiter chars.
delimiter[new delimiter chars]change the delimiter charsit will change the old delimiter chars.this command function is same to the command chdelimiter
mvpathno paramtershow current downloaded mvpathshow the save downloaded mvpath
songpathno paramtershow current downloaded songpathshow the save downloaded songpath
chmvpath[newmvpath]change the current mvpathchange the save downloaded mv path. Use the ~ to recovery the default dirctory
chsongpath[newsongpath]change the current songpathchange the save downloaded song path. Use the ~to recovery the default dirctory
help or hno paramtershow help docshow the help information
quit or CTRL+Cno paramterquit the programquit the program
exit or CTRL+Cno paramterquit the programquit the program
cls or clearno paramterclear the log informationclear the log information.In current version,it is only support the windows clear log.next version will add the linux clear log function

2.the following is the picture of help document,which is runned int the goland ide.
help document
help document
help document

Usages

In this section. I will use the search song keyword:bigbig and 天使的翅膀, and the search mv keyword :Falling Down and 小幸运 as the example to show how to use the somusic program.

1.search song with keyword.

command: qsong bigbig(bigbig)
qsong
command: qsong 天使的翅膀(天使的翅膀)
qsong

2.search mv with keyword.

command: qmv falling down(falling down)
qmv
command: qmv 小幸运(小幸运)
qmv

3.list the searched song information.

command: lsong(小幸运)
lsong
command: lsong 11(big big world)
lsong
command: lsong(天使的翅膀)
lsong

4.list the searched mv informtion.

command: lmv(Falling Down)
lmv
lmv
command:lmv(小幸运)
lmv

5.download the searched song.

command: gsong 3,6(big big world)
gsong

6.download the searched mv.

command: gmv 1-10(Falling Down)
gmv
gmv
command:gmv 1-5(小幸运)
gmv
gmv

7.show the local downloaded songs.

command: ssong
ssong
ssong

8.show the local donwloaded mvs.

command: smv
smv

9.show the current saved download songs' directory.

command: songpath
songpath

10.show the current saved download mvs' directory.

command: mvpath
mvpath

11.change the saved download mvs' directory.

command: chmvpath D:\歌曲
chmvpath

12.change the saved download mvs' directory.

command: chsongpath D:\歌曲
chsongpath

13.change the program command line style.

command: style mimusic
style

14.change the program command line delimiter.

command: delimiter #
delimiter

15.show or find the help document.

command: help
help document
help document
help document

16.quit or exit the program.

command: exit
exit

17.clear the log information.

command: cls
cls

Reference

  1. gjson(https://github.com/tidwall/gjson)
  2. goquery(https://github.com/PuerkitoBio/goquery)
  3. gorm(https://github.com/jinzhu/gorm)
  4. beego orm(https://github.com/astaxie/beego/orm)
  5. beego logs(https://github.com/astaxie/beego/logs)
  6. regexp standard library(https://studygolang.com/pkgdoc)
  7. net/http standard library(https://studygolang.com/pkgdoc)
  8. channel&goroutine(https://gobyexample.com)

What's need to Improve

  • 1.play song or play mv in reality.
  • 2.config the variables into the file.such as save download song directory and mv directory,software command line style and delimiter.
  • 3.add the cache module.which can improve the somusic's performance.

Contace Me

If you are interested in this project、 like coding or any questions,you can contact with me by following ways.

QQ:2282186474

WeChat:wen2282186474

Eamil: 2282186474@qq.com

project github: https://github.com/jaydenwen123/Somusic

转载于:https://www.cnblogs.com/wenxiaofei/p/10927176.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值