diff --git a/README.md b/README.md index f90c341f..d7c1a7e0 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ BaiduPCS-Go loglist ## 切换已登录的百度帐号 ``` -BaiduPCS-Go su -uid=12345678 +BaiduPCS-Go su ``` ``` BaiduPCS-Go su @@ -326,6 +326,57 @@ BaiduPCS-Go mv /我的资源/1.mp4 / BaiduPCS-Go mv /我的资源/1.mp4 /我的资源/3.mp4 ``` +## 离线下载 +``` +BaiduPCS-Go offlinedl +BaiduPCS-Go clouddl +BaiduPCS-Go od +``` + +离线下载支持http/https/ftp/电驴/磁力链协议 + +### 添加离线下载任务 +``` +BaiduPCS-Go offlinedl add -path=<离线下载文件保存的路径> 资源地址1 地址2 ... +``` + +添加任务成功之后, 返回离线下载的任务ID. + +### 精确查询离线下载任务 +``` +BaiduPCS-Go offlinedl query 任务ID1 任务ID2 ... +``` + +### 查询离线下载任务列表 +``` +BaiduPCS-Go offlinedl list +``` + +### 取消离线下载任务 +``` +BaiduPCS-Go offlinedl cancel 任务ID1 任务ID2 ... +``` + +### 删除离线下载任务 +``` +BaiduPCS-Go offlinedl delete 任务ID1 任务ID2 ... +``` + +#### 例子 +``` +# 将百度和腾讯主页, 离线下载到根目录 / +BaiduPCS-Go offlinedl add -path=/ http://baidu.com http://qq.com + +# 添加磁力链接任务 +BaiduPCS-Go offlinedl add magnet:?xt=urn:btih:xxx + +# 查询任务ID为 12345 的离线下载任务状态 +BaiduPCS-Go offlinedl query + +# 取消任务ID为 12345 的离线下载任务 +BaiduPCS-Go offlinedl cancel 12345 +``` + ## 显示和修改程序配置项 ``` BaiduPCS-Go config diff --git a/build.sh b/build.sh index 1cd9c21d..a6aba9f7 100644 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ name="BaiduPCS-Go" version=$1 if [ "$1" = "" ];then - version=v3.3.1 + version=v3.3.2 fi output="out/" diff --git a/main.go b/main.go index b4acd723..63413a81 100644 --- a/main.go +++ b/main.go @@ -27,7 +27,7 @@ import ( var ( // Version 版本号 - Version = "v3.3.1" + Version = "v3.3.2" historyFilePath = pcsutil.ExecutablePathJoin("pcs_command_history.txt") reloadFn = func(c *cli.Context) error { @@ -644,11 +644,12 @@ func main() { }, }, { - Name: "offlinedl", - Aliases: []string{"clouddl", "od"}, - Usage: "离线下载", - Category: "百度网盘", - Before: reloadFn, + Name: "offlinedl", + Aliases: []string{"clouddl", "od"}, + Usage: "离线下载", + Description: `支持http/https/ftp/电驴/磁力链协议`, + Category: "百度网盘", + Before: reloadFn, Action: func(c *cli.Context) error { if c.NumFlags() <= 0 || c.NArg() <= 0 { cli.ShowCommandHelp(c, c.Command.Name) @@ -657,10 +658,10 @@ func main() { }, Subcommands: []cli.Command{ { - Name: "addtask", - Aliases: []string{"at", "a"}, + Name: "add", + Aliases: []string{"a"}, Usage: "添加离线下载任务", - UsageText: app.Name + " offlinedl addtask -path=<离线下载文件保存的路径> 资源地址1 地址2 ...", + UsageText: app.Name + " offlinedl add -path=<离线下载文件保存的路径> 资源地址1 地址2 ...", Action: func(c *cli.Context) error { if c.NArg() < 1 { cli.ShowCommandHelp(c, c.Command.Name) @@ -678,10 +679,10 @@ func main() { }, }, { - Name: "querytask", - Aliases: []string{"qt", "q"}, + Name: "query", + Aliases: []string{"q"}, Usage: "精确查询离线下载任务", - UsageText: app.Name + " offlinedl querytask 任务ID1 任务ID2 ...", + UsageText: app.Name + " offlinedl query 任务ID1 任务ID2 ...", Action: func(c *cli.Context) error { if c.NArg() < 1 { cli.ShowCommandHelp(c, c.Command.Name) @@ -700,20 +701,20 @@ func main() { }, }, { - Name: "listtask", - Aliases: []string{"lt", "l"}, + Name: "list", + Aliases: []string{"ls", "l"}, Usage: "查询离线下载任务列表", - UsageText: app.Name + " offlinedl listtask", + UsageText: app.Name + " offlinedl list", Action: func(c *cli.Context) error { pcscommand.RunCloudDlListTask() return nil }, }, { - Name: "canceltask", - Aliases: []string{"ct", "c"}, + Name: "cancel", + Aliases: []string{"c"}, Usage: "取消离线下载任务", - UsageText: app.Name + " offlinedl listtask 任务ID1 任务ID2 ...", + UsageText: app.Name + " offlinedl cancel 任务ID1 任务ID2 ...", Action: func(c *cli.Context) error { if c.NArg() < 1 { cli.ShowCommandHelp(c, c.Command.Name) @@ -732,10 +733,10 @@ func main() { }, }, { - Name: "deletetask", - Aliases: []string{"dt", "d"}, + Name: "delete", + Aliases: []string{"del", "d"}, Usage: "删除离线下载任务", - UsageText: app.Name + " offlinedl deletetask 任务ID1 任务ID2 ...", + UsageText: app.Name + " offlinedl delete 任务ID1 任务ID2 ...", Action: func(c *cli.Context) error { if c.NArg() < 1 { cli.ShowCommandHelp(c, c.Command.Name) diff --git a/resource_windows.syso b/resource_windows.syso index 8cc90ee3..9492ab27 100644 Binary files a/resource_windows.syso and b/resource_windows.syso differ diff --git a/versioninfo.json b/versioninfo.json index 37a5cd5b..d7f494ff 100644 --- a/versioninfo.json +++ b/versioninfo.json @@ -3,13 +3,13 @@ "FileVersion": { "Major": 3, "Minor": 3, - "Patch": 1, + "Patch": 2, "Build": 0 }, "ProductVersion": { "Major": 3, "Minor": 3, - "Patch": 1, + "Patch": 2, "Build": 0 }, "FileFlagsMask": "3f", @@ -22,14 +22,14 @@ "Comments": "", "CompanyName": "iikira", "FileDescription": "百度网盘客户端", - "FileVersion": "v3.3.1", + "FileVersion": "v3.3.2", "InternalName": "", "LegalCopyright": "© 2016-2018 iikira.", "LegalTrademarks": "", "OriginalFilename": "", "PrivateBuild": "", "ProductName": "BaiduPCS-Go", - "ProductVersion": "v3.3.1", + "ProductVersion": "v3.3.2", "SpecialBuild": "" }, "VarFileInfo": {