Skip to content

Commit a96741c

Browse files
committed
v3.9.1
1 parent e21feaf commit a96741c

File tree

7 files changed

+16
-57
lines changed

7 files changed

+16
-57
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ iikira/BaiduPCS-Go was largely inspired by [GangZhuo/BaiduPCS](https://github.co
100100
[离线下载](#离线下载), 支持http/https/ftp/电驴/磁力链协议.
101101

102102
# 版本更新
103+
**2023.03.19** v3.9.1
104+
- 修复秒传转存返回错误码9019
105+
103106
**2022.12.04** v3.9.0:
104107
- 优化转存错误提示
105108
- fix #239

baidupcs/pcserror/xpanerrorinfo.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (pane *XPanErrorInfo) Error() string {
9393

9494
return fmt.Sprintf("%s, 遇到错误, %s", pane.Operation, pane.Err)
9595
default:
96-
panic("panerrorinfo: unknown ErrType")
96+
panic("xpanerrorinfo: unknown ErrType")
9797
}
9898
}
9999

@@ -103,9 +103,13 @@ func FindXPanErr(errno int) (errmsg string) {
103103
case 0:
104104
return StrSuccess
105105
case 2:
106-
return "md5不存在"
106+
return "文件长度异常"
107107
case -8:
108108
return "同名文件冲突"
109+
case 31190:
110+
return "MD5不存在"
111+
case 31079:
112+
return "文件已被屏蔽"
109113
default:
110114
return "未知错误"
111115
}

baidupcs/prepare.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ func (pcs *BaiduPCS) PrepareRapidUploadV2(targetPath, contentMD5 string, length
335335
return nil, pcsError
336336
}
337337

338-
pcsURL := pcs.generatePCSURL2("xpan/file", "create", nil)
338+
pcsURL := pcs.generatePanURL("create", nil)
339339
post := map[string]string{
340340
"path": targetPath,
341341
"size": strconv.FormatInt(length, 10),

baidupcs/upload.go

-47
Original file line numberDiff line numberDiff line change
@@ -118,29 +118,6 @@ func (pcs *BaiduPCS) RapidUpload(targetPath, contentMD5, sliceMD5, crc32 string,
118118
}()
119119

120120
return pcs.rapidUploadV2(targetPath, strings.ToLower(contentMD5), length)
121-
122-
//// 尝试全大写
123-
//pcsError = pcs.rapidUpload(targetPath, strings.ToUpper(contentMD5), strings.ToUpper(sliceMD5), crc32, length)
124-
//if pcsError == nil || pcsError.GetRemoteErrCode() != 31079 {
125-
// return
126-
//}
127-
//
128-
//// 尝试全小写
129-
//pcsError = pcs.rapidUpload(targetPath, strings.ToLower(contentMD5), strings.ToLower(sliceMD5), crc32, length)
130-
//if pcsError == nil || pcsError.GetRemoteErrCode() != 31079 {
131-
// return
132-
//}
133-
//
134-
//// 尝试随机大小写
135-
//pcsError = pcs.rapidUpload(targetPath, randomifyMD5(contentMD5), randomifyMD5(sliceMD5), crc32, length)
136-
//if pcsError == nil || pcsError.GetRemoteErrCode() != 31079 {
137-
// return
138-
//}
139-
//
140-
//return
141-
142-
//// 尝试 xpan 接口
143-
//return pcs.rapidUploadV2(targetPath, strings.ToLower(contentMD5), length)
144121
}
145122

146123
func (pcs *BaiduPCS) rapidUpload(targetPath, contentMD5, sliceMD5, crc32 string, length int64) (pcsError pcserror.Error) {
@@ -159,30 +136,6 @@ func (pcs *BaiduPCS) rapidUploadV2(targetPath, contentMD5 string, length int64)
159136
}
160137
defer dataReadCloser.Close()
161138
return pcserror.DecodeXPanJSONError(OperationRapidUpload, dataReadCloser)
162-
163-
//errInfo := pcserror.NewPanErrorInfo(OperationRapidUpload)
164-
//jsonData := uploadCreateJSON{
165-
// PanErrorInfo: errInfo,
166-
//}
167-
//pcsError = pcserror.HandleJSONParse(OperationRapidUpload, dataReadCloser, &jsonData)
168-
//if pcsError != nil {
169-
// return
170-
//}
171-
//fmt.Println(jsonData)
172-
//switch jsonData.ErrNo {
173-
//case 0:
174-
// return
175-
//case 2:
176-
// errInfo.SetRemoteError()
177-
// errInfo.Err = ErrUploadMD5Unknown
178-
// return errInfo
179-
//case -8:
180-
// return nil
181-
//default:
182-
// errInfo.ErrType = pcserror.ErrTypeOthers
183-
// errInfo.Err = fmt.Errorf("errno=%d", jsonData.ErrNo)
184-
// return errInfo
185-
//}
186139
}
187140

188141
// RapidUploadNoCheckDir 秒传文件, 不进行目录检查, 会覆盖掉同名的目录!

internal/pcscommand/transfer.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ func RunRapidTransfer(link string) {
136136
md5 := substrs[0]
137137
length, _ := strconv.ParseInt(substrs[1], 10, 64)
138138
filename := path.Join(GetActiveUser().Workdir, substrs[2])
139-
slicemd5 := ""
140-
RunRapidUpload(filename, md5, slicemd5, "", length)
139+
RunRapidUpload(filename, md5, "", "", length)
141140
return
142141
}
143142
substrs = strings.Split(link, "|")

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const (
5555

5656
var (
5757
// Version 版本号
58-
Version = "v3.9.0-devel"
58+
Version = "v3.9.1-devel"
5959

6060
historyFilePath = filepath.Join(pcsconfig.GetConfigDir(), "pcs_command_history.txt")
6161
reloadFn = func(c *cli.Context) error {

versioninfo.json

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

0 commit comments

Comments
 (0)