Skip to content

Commit 2f33da0

Browse files
committed
v3.9.6
关闭秒传功能 修复转存失败问题
1 parent 624ac21 commit 2f33da0

File tree

5 files changed

+32
-35
lines changed

5 files changed

+32
-35
lines changed

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ iikira/BaiduPCS-Go was largely inspired by [GangZhuo/BaiduPCS](https://github.co
9797
[离线下载](#离线下载), 支持http/https/ftp/电驴/磁力链协议.
9898

9999
# 版本更新
100+
**2024.12.14** v3.9.6
101+
- 关闭秒传转存功能
102+
- 修复常规转存失败
103+
100104
**2023.09.30** v3.9.5
101105
- 恢复秒传转存功能, 使用前需设置accessToken, 参见setastoken --help
102106
- 本地文件上传用秒传无须accessToken
@@ -671,7 +675,7 @@ BaiduPCS-Go sf <本地文件的路径>
671675
672676
```
673677

674-
获取本地文件的大小, md5, 前256KB切片的 md5, crc32, 可用于秒传文件.
678+
获取本地文件的大小, md5, 前256KB切片的 md5, crc32.
675679

676680
#### 例子:
677681

@@ -697,13 +701,7 @@ BaiduPCS-Go ep <文件/目录1> <文件/目录2> ...
697701

698702
#### 注意
699703

700-
**无法导出 20GB 以上的文件!!**
701-
702-
**无法导出文件的版本历史等数据!!**
703-
704-
**以通用秒传格式导出会丢失文件路径信息!!**
705-
706-
并不是所有的文件都能导出成功, 程序会列出无法导出的文件列表
704+
**秒传已不被支持, 该功能已无实际作用**
707705

708706
#### 例子:
709707

@@ -801,7 +799,6 @@ BaiduPCS-Go mv /我的资源/1.mp4 /我的资源/3.mp4
801799
```
802800
# 转存分享链接里的文件到当前目录:
803801
BaiduPCS-Go transfer <分享链接> <提取码>
804-
BaiduPCS-Go transfer <秒传链接>
805802
```
806803

807804
注意: 转存文件保存到当前工作目录下, 不支持指定.

baidupcs/transfer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ func (pcs *BaiduPCS) AccessSharePage(featurestr string, first bool) (tokens map[
124124
if !first {
125125
headers["Referer"] = fmt.Sprintf("https://pan.baidu.com/share/init?surl=%s", featurestr[1:])
126126
}
127-
sharelink := fmt.Sprintf("https://pan.baidu.com/s/%s", featurestr)
127+
shareLink := fmt.Sprintf("https://pan.baidu.com/s/%s", featurestr)
128128

129-
dataReadCloser, panError := pcs.sendReqReturnReadCloser(reqTypePan, OperationShareFileSavetoLocal, http.MethodGet, sharelink, nil, headers)
129+
dataReadCloser, panError := pcs.sendReqReturnReadCloser(reqTypePan, OperationShareFileSavetoLocal, http.MethodGet, shareLink, nil, headers)
130130

131131
if panError != nil {
132132
tokens["ErrMsg"] = "访问分享页失败"

internal/pcscommand/transfer.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ import (
1414
// RunShareTransfer 执行分享链接转存到网盘
1515
func RunShareTransfer(params []string, opt *baidupcs.TransferOption) {
1616
var link string
17-
var extracode string
17+
var extraCode string
1818
if len(params) == 1 {
1919
link = params[0]
2020
if strings.Contains(link, "bdlink=") || !strings.Contains(link, "pan.baidu.com/") {
21-
RunRapidTransfer(link, opt.Rname)
22-
//fmt.Printf("%s失败: %s\n", baidupcs.OperationShareFileSavetoLocal, "秒传已不再被支持")
21+
//RunRapidTransfer(link, opt.Rname)
22+
fmt.Printf("%s失败: %s\n", baidupcs.OperationShareFileSavetoLocal, "秒传已不再被支持")
2323
return
2424
}
25-
extracode = "none"
25+
extraCode = "none"
2626
if strings.Contains(link, "?pwd=") {
27-
extracode = strings.Split(link, "?pwd=")[1]
27+
extraCode = strings.Split(link, "?pwd=")[1]
2828
link = strings.Split(link, "?pwd=")[0]
2929
}
3030
} else if len(params) == 2 {
3131
link = params[0]
32-
extracode = params[1]
32+
extraCode = params[1]
3333
}
3434
if link[len(link)-1:] == "/" {
3535
link = link[0 : len(link)-1]
@@ -39,7 +39,7 @@ func RunShareTransfer(params []string, opt *baidupcs.TransferOption) {
3939
if strings.Contains(featureStr, "init?") {
4040
featureStr = "1" + strings.Split(featureStr, "=")[1]
4141
}
42-
if len(featureStr) > 23 || featureStr[0:1] != "1" || len(extracode) != 4 {
42+
if len(featureStr) > 23 || featureStr[0:1] != "1" || len(extraCode) != 4 {
4343
fmt.Printf("%s失败: %s\n", baidupcs.OperationShareFileSavetoLocal, "链接地址或提取码非法")
4444
return
4545
}
@@ -50,15 +50,15 @@ func RunShareTransfer(params []string, opt *baidupcs.TransferOption) {
5050
return
5151
}
5252

53-
if extracode != "none" {
53+
if extraCode != "none" {
5454
verifyUrl := pcs.GenerateShareQueryURL("verify", map[string]string{
5555
"shareid": tokens["shareid"],
5656
"time": strconv.Itoa(int(time.Now().UnixMilli())),
5757
"clienttype": "1",
5858
"uk": tokens["share_uk"],
5959
}).String()
6060
res := pcs.PostShareQuery(verifyUrl, link, map[string]string{
61-
"pwd": extracode,
61+
"pwd": extraCode,
6262
"vcode": "null",
6363
"vcode_str": "null",
6464
"bdstoken": tokens["bdstoken"],
@@ -79,7 +79,7 @@ func RunShareTransfer(params []string, opt *baidupcs.TransferOption) {
7979
"bdstoken": tokens["bdstoken"],
8080
"root": "1",
8181
"web": "5",
82-
"app_id": "250528",
82+
"app_id": baidupcs.PanAppID,
8383
"shorturl": featureStr[1:],
8484
"channel": "chunlei",
8585
}

main.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const (
5656
var (
5757
// Version 版本号
5858
//Version = "v3.9.4-devel"
59-
Version = "v3.9.5-devel"
59+
Version = "v3.9.6-devel"
6060

6161
historyFilePath = filepath.Join(pcsconfig.GetConfigDir(), "pcs_command_history.txt")
6262
reloadFn = func(c *cli.Context) error {
@@ -604,8 +604,8 @@ func main() {
604604
},
605605
},
606606
{
607-
Name: "setastoken",
608-
Usage: "设定当前账号的accessToken",
607+
Name: "setastoken",
608+
Usage: "设定当前账号的accessToken",
609609
Description: `
610610
设定当前登录帐号的accessToken:
611611
若不使用秒传链接转存, 可不设定; accessToken申请及获取教程:
@@ -615,9 +615,9 @@ func main() {
615615
示例:
616616
BaiduPCS-Go setastoken 156.182v9052tgf1006c89891bsfb2401974.YmKOAwBD9yGaG2s4p5NNkX4CXeIbJxx4hAxotfS.PyuHEs
617617
`,
618-
Category: "百度帐号",
619-
Before: reloadFn,
620-
After: saveFunc,
618+
Category: "百度帐号",
619+
Before: reloadFn,
620+
After: saveFunc,
621621
Action: func(c *cli.Context) error {
622622
activeUser := pcsconfig.Config.ActiveUser()
623623
if activeUser.UID == 0 {
@@ -1161,7 +1161,7 @@ func main() {
11611161
Usage: "将本地文件的修改时间设置为服务器上的修改时间",
11621162
},
11631163
cli.IntFlag{
1164-
Name: "dindex",
1164+
Name: "dindex",
11651165
Usage: "使用备选下载链接中的第几个,默认第一个",
11661166
},
11671167
cli.BoolFlag{
@@ -1519,8 +1519,8 @@ func main() {
15191519
return nil
15201520
}
15211521
opt := &baidupcs.ShareOption{
1522-
Password: c.String("p"),
1523-
Period: c.Int("period"),
1522+
Password: c.String("p"),
1523+
Period: c.Int("period"),
15241524
IsCombined: c.Bool("f"),
15251525
}
15261526
pcscommand.RunShareSet(c.Args(), opt)
@@ -1538,7 +1538,7 @@ func main() {
15381538
Value: 0,
15391539
},
15401540
cli.BoolFlag{
1541-
Name: "f",
1541+
Name: "f",
15421542
Usage: "输出带密码的完整链接格式",
15431543
},
15441544
},

versioninfo.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"FileVersion": {
44
"Major": 3,
55
"Minor": 9,
6-
"Patch": 5,
6+
"Patch": 6,
77
"Build": 0
88
},
99
"ProductVersion": {
1010
"Major": 3,
1111
"Minor": 9,
12-
"Patch": 5,
12+
"Patch": 6,
1313
"Build": 0
1414
},
1515
"FileFlagsMask": "3f",
@@ -22,14 +22,14 @@
2222
"Comments": "",
2323
"CompanyName": "qjfoidnh",
2424
"FileDescription": "百度网盘客户端(加强版)",
25-
"FileVersion": "v3.9.5",
25+
"FileVersion": "v3.9.6",
2626
"InternalName": "",
2727
"LegalCopyright": "© 2016-2020 iikira.",
2828
"LegalTrademarks": "",
2929
"OriginalFilename": "",
3030
"PrivateBuild": "",
3131
"ProductName": "BaiduPCS-Go",
32-
"ProductVersion": "v3.9.5",
32+
"ProductVersion": "v3.9.6",
3333
"SpecialBuild": ""
3434
},
3535
"VarFileInfo": {

0 commit comments

Comments
 (0)