fix(vtencent): hack file with size 0 but actual size is not 0

- allow use another proxy for vtencent and chaoxing
This commit is contained in:
Andy Hsu 2023-11-23 22:29:04 +08:00
parent fe34d30d17
commit d455a232ef
4 changed files with 13 additions and 8 deletions

View File

@ -5,7 +5,7 @@ import (
"github.com/alist-org/alist/v3/internal/op"
)
// 此程序挂载的是超星小组网盘,需要代理才能用;
// 此程序挂载的是超星小组网盘,需要代理才能使用;
// 登录超星后进入个人空间,进入小组,新建小组,点击进去。
// url中就有bbsid的参数,系统限制单文件大小2G,没有总容量限制
type Addition struct {
@ -30,9 +30,9 @@ func init() {
op.RegisterDriver(func() driver.Driver {
return &ChaoXing{
config: driver.Config{
Name: "超星小组盘",
Name: "ChaoXingGroupDrive",
OnlyProxy: true,
OnlyLocal: true,
OnlyLocal: false,
DefaultRoot: "-1",
NoOverwriteUpload: true,
},

View File

@ -90,7 +90,7 @@ func (d *Vtencent) Link(ctx context.Context, file model.Obj, args model.LinkArgs
return nil, err
}
u := resps.Data.DownloadURLInfoSet[0].DownloadURL
return &model.Link{
link := &model.Link{
URL: u,
Header: http.Header{
"Referer": []string{d.conf.referer},
@ -98,7 +98,12 @@ func (d *Vtencent) Link(ctx context.Context, file model.Obj, args model.LinkArgs
},
Concurrency: 2,
PartSize: 10 * utils.MB,
}, nil
}
if file.GetSize() == 0 {
link.Concurrency = 0
link.PartSize = 0
}
return link, nil
}
func (d *Vtencent) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {

View File

@ -23,9 +23,9 @@ func init() {
op.RegisterDriver(func() driver.Driver {
return &Vtencent{
config: driver.Config{
Name: "腾讯智能创作平台",
Name: "VTencent",
OnlyProxy: true,
OnlyLocal: true,
OnlyLocal: false,
DefaultRoot: "9",
NoOverwriteUpload: true,
},

View File

@ -11,7 +11,7 @@ type Config struct {
DefaultRoot string `json:"default_root"`
CheckStatus bool `json:"-"`
Alert string `json:"alert"` //info,success,warning,danger
NoOverwriteUpload bool `json:"-"`
NoOverwriteUpload bool `json:"-"` // whether to support overwrite upload
}
func (c Config) MustProxy() bool {