diff options
| -rw-r--r-- | LICENSE | 21 | ||||
| -rw-r--r-- | README.md | 31 | ||||
| -rw-r--r-- | main.go | 5 |
3 files changed, 52 insertions, 5 deletions
@@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Verdant + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..42b082b --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# BVD + +快速、高效、易用的B站视频下载工具。 + +## 用法 + +``` +NAME: + bvd - 快速、高效、易用的下载B站视频 CLI 工具 + +USAGE: + bvd [global options] command [command options] + +COMMANDS: + download 下载指定 BV 号的视频 + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --help, -h show help +``` + +示例: +``` +➜ build git:(main) ✗ ./bvd download BV1ewwxesEu4 +成功获取 1 个下载链接(每个CID一个) +成功获取 1 个下载链接 +开始下载第 1 个文件 +重定向到: https://2075945923.ahdohpiechei.com:22443/upos-sz-302kodo.bilivideo.com/upgcxcode/63/72/25747527263/25747527263-1-192.mp4?e=ig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&platform=pc&trid=c2a0c05a2ee94fbd96c53ce92f72347u&mid=0&deadline=1762708223&gen=playurlv3&og=cos&nbs=1&uipk=5&oi=0x240882100c0050e141e6a88412ebe3b0&os=upos&upsig=ad0ee0473289dfa0f8a82729abda08ec&uparams=e,platform,trid,mid,deadline,gen,og,nbs,uipk,oi,os&bvc=vod&nettype=0&bw=774621&f=u_0_0&agrr=0&buvid=&build=0&dl=0&orderid=0,3&x-sid=0X11AByYhtbkSf&x-redirect=0X11A&x-lid=0X11Ababaf291f9bb&x-st=0X11Ahash +保存到: downloads/gugugaga🐧🐧🐧.mp4 +文件下载成功: downloads/gugugaga🐧🐧🐧.mp4 +``` @@ -146,9 +146,6 @@ func getDownloadUrl(video VideoBaseInfo, bvid string) ([]string, error) { } fmt.Printf("成功获取 %d 个下载链接(每个CID一个)\n", len(downloadUrls)) - fmt.Printf("下载链接:%s\n", downloadUrls) - fmt.Printf("下载链接1:%s\n", downloadUrls[0]) - fmt.Printf("下载链接2:%s\n", downloadUrls[1]) return downloadUrls, nil } @@ -169,9 +166,7 @@ func downloadVideo(video VideoBaseInfo, bvid string) error { fmt.Printf("成功获取 %d 个下载链接\n", len(urls)) for i := 0; i < len(urls); i++ { - fmt.Println("url[1]", urls[1]) fmt.Printf("开始下载第 %d 个文件\n", i+1) - fmt.Printf("Url: %s\n", urls[i]) // 创建支持重定向的 HTTP 客户端 client := &http.Client{ |
