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:
parent
fe34d30d17
commit
d455a232ef
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/alist-org/alist/v3/internal/op"
|
"github.com/alist-org/alist/v3/internal/op"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 此程序挂载的是超星小组网盘,需要代理才能只用;
|
// 此程序挂载的是超星小组网盘,需要代理才能使用;
|
||||||
// 登录超星后进入个人空间,进入小组,新建小组,点击进去。
|
// 登录超星后进入个人空间,进入小组,新建小组,点击进去。
|
||||||
// url中就有bbsid的参数,系统限制单文件大小2G,没有总容量限制
|
// url中就有bbsid的参数,系统限制单文件大小2G,没有总容量限制
|
||||||
type Addition struct {
|
type Addition struct {
|
||||||
@ -30,9 +30,9 @@ func init() {
|
|||||||
op.RegisterDriver(func() driver.Driver {
|
op.RegisterDriver(func() driver.Driver {
|
||||||
return &ChaoXing{
|
return &ChaoXing{
|
||||||
config: driver.Config{
|
config: driver.Config{
|
||||||
Name: "超星小组盘",
|
Name: "ChaoXingGroupDrive",
|
||||||
OnlyProxy: true,
|
OnlyProxy: true,
|
||||||
OnlyLocal: true,
|
OnlyLocal: false,
|
||||||
DefaultRoot: "-1",
|
DefaultRoot: "-1",
|
||||||
NoOverwriteUpload: true,
|
NoOverwriteUpload: true,
|
||||||
},
|
},
|
||||||
|
@ -90,7 +90,7 @@ func (d *Vtencent) Link(ctx context.Context, file model.Obj, args model.LinkArgs
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
u := resps.Data.DownloadURLInfoSet[0].DownloadURL
|
u := resps.Data.DownloadURLInfoSet[0].DownloadURL
|
||||||
return &model.Link{
|
link := &model.Link{
|
||||||
URL: u,
|
URL: u,
|
||||||
Header: http.Header{
|
Header: http.Header{
|
||||||
"Referer": []string{d.conf.referer},
|
"Referer": []string{d.conf.referer},
|
||||||
@ -98,7 +98,12 @@ func (d *Vtencent) Link(ctx context.Context, file model.Obj, args model.LinkArgs
|
|||||||
},
|
},
|
||||||
Concurrency: 2,
|
Concurrency: 2,
|
||||||
PartSize: 10 * utils.MB,
|
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 {
|
func (d *Vtencent) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {
|
||||||
|
@ -23,9 +23,9 @@ func init() {
|
|||||||
op.RegisterDriver(func() driver.Driver {
|
op.RegisterDriver(func() driver.Driver {
|
||||||
return &Vtencent{
|
return &Vtencent{
|
||||||
config: driver.Config{
|
config: driver.Config{
|
||||||
Name: "腾讯智能创作平台",
|
Name: "VTencent",
|
||||||
OnlyProxy: true,
|
OnlyProxy: true,
|
||||||
OnlyLocal: true,
|
OnlyLocal: false,
|
||||||
DefaultRoot: "9",
|
DefaultRoot: "9",
|
||||||
NoOverwriteUpload: true,
|
NoOverwriteUpload: true,
|
||||||
},
|
},
|
||||||
|
@ -11,7 +11,7 @@ type Config struct {
|
|||||||
DefaultRoot string `json:"default_root"`
|
DefaultRoot string `json:"default_root"`
|
||||||
CheckStatus bool `json:"-"`
|
CheckStatus bool `json:"-"`
|
||||||
Alert string `json:"alert"` //info,success,warning,danger
|
Alert string `json:"alert"` //info,success,warning,danger
|
||||||
NoOverwriteUpload bool `json:"-"`
|
NoOverwriteUpload bool `json:"-"` // whether to support overwrite upload
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Config) MustProxy() bool {
|
func (c Config) MustProxy() bool {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user