Skip to content

Commit

Permalink
v3.8.9
Browse files Browse the repository at this point in the history
  • Loading branch information
qjfoidnh committed Nov 25, 2022
1 parent c7c7628 commit 7e0a723
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ iikira/BaiduPCS-Go was largely inspired by [GangZhuo/BaiduPCS](https://github.co
[离线下载](#离线下载), 支持http/https/ftp/电驴/磁力链协议.

# 版本更新
**2022.11.25** v3.8.9:
- fix #234, 继续修复无法转存文件

**2022.11.12** v3.8.8:
- fix #234, 修复无法转存文件

Expand Down
21 changes: 10 additions & 11 deletions baidupcs/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package baidupcs

import (
"fmt"
"github.com/qjfoidnh/BaiduPCS-Go/baidupcs/netdisksign"
"github.com/qjfoidnh/BaiduPCS-Go/requester"
"github.com/tidwall/gjson"
"io/ioutil"
"net/http"
Expand All @@ -29,14 +29,12 @@ func (pcs *BaiduPCS) GenerateShareQueryURL(subPath string, params map[string]str
Host: PanBaiduCom,
Path: "/share/" + subPath,
}
ns := netdisksign.NewLocateDownloadSign(pcs.uid, pcs.GetBDUSS())
uv := shareURL.Query()
uv.Set("apn_id", "1_0")
uv.Set("channel", "android_7.0_VTR-AL00_bd-netdisk_1026250y")
uv.Set("time", strconv.Itoa(int(time.Now().UnixMilli())))
uv.Set("cuid", ns.DevUID)
uv.Set("devuid", ns.DevUID)
uv.Set("clienttype", "1")
uv.Set("app_id", PanAppID)
uv.Set("channel", "chunlei")
uv.Set("t", strconv.Itoa(int(time.Now().UnixMilli())))
uv.Set("web", "1")
uv.Set("clienttype", "0")
for key, value := range params {
uv.Set(key, value)
}
Expand Down Expand Up @@ -87,10 +85,11 @@ func (pcs *BaiduPCS) ExtractShareInfo(metajsonstr string) (res map[string]string
return
}

func (pcs *BaiduPCS) PostShareQuery(url string, data map[string]string) (res map[string]string) {
func (pcs *BaiduPCS) PostShareQuery(url string, referer string, data map[string]string) (res map[string]string) {
dataReadCloser, panError := pcs.sendReqReturnReadCloser(reqTypePan, OperationShareFileSavetoLocal, http.MethodPost, url, data, map[string]string{
"User-Agent": pcs.panUA,
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": requester.UserAgent,
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"Referer": referer,
})
res = make(map[string]string)
if panError != nil {
Expand Down
9 changes: 4 additions & 5 deletions internal/pcscommand/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,15 @@ func RunShareTransfer(params []string, opt *baidupcs.TransferOption) {
var vefiryurl string
var randsk string
featuremap := make(map[string]string)
featuremap["shareid"] = tokens["shareid"]
featuremap["uk"] = tokens["share_uk"]
featuremap["bdstoken"] = tokens["bdstoken"]
featuremap["surl"] = featurestr[1:len(featurestr)]
if extracode != "none" {

vefiryurl = pcs.GenerateShareQueryURL("verify", featuremap).String()
res := pcs.PostShareQuery(vefiryurl, map[string]string{
res := pcs.PostShareQuery(vefiryurl, link, map[string]string{
"pwd": extracode,
"vcode": "",
"vcode_str": "null",
"bdstoken": tokens["bdstoken"],
"vcode_str": "",
})
if res["ErrMsg"] != "0" {
fmt.Printf("%s失败: %s\n", baidupcs.OperationShareFileSavetoLocal, res["ErrMsg"])
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const (

var (
// Version 版本号
Version = "v3.8.8-devel"
Version = "v3.8.9-devel"

historyFilePath = filepath.Join(pcsconfig.GetConfigDir(), "pcs_command_history.txt")
reloadFn = func(c *cli.Context) error {
Expand Down
8 changes: 4 additions & 4 deletions versioninfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"FileVersion": {
"Major": 3,
"Minor": 8,
"Patch": 8,
"Patch": 9,
"Build": 0
},
"ProductVersion": {
"Major": 3,
"Minor": 8,
"Patch": 8,
"Patch": 9,
"Build": 0
},
"FileFlagsMask": "3f",
Expand All @@ -22,14 +22,14 @@
"Comments": "",
"CompanyName": "qjfoidnh",
"FileDescription": "百度网盘客户端(加强版)",
"FileVersion": "v3.8.8",
"FileVersion": "v3.8.9",
"InternalName": "",
"LegalCopyright": "© 2016-2020 iikira.",
"LegalTrademarks": "",
"OriginalFilename": "",
"PrivateBuild": "",
"ProductName": "BaiduPCS-Go",
"ProductVersion": "v3.8.8",
"ProductVersion": "v3.8.9",
"SpecialBuild": ""
},
"VarFileInfo": {
Expand Down

0 comments on commit 7e0a723

Please sign in to comment.