Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions drivers/139/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ func (d *Yun139) GetAddition() driver.Additional {

func (d *Yun139) Init(ctx context.Context) error {
if d.ref == nil {
if len(d.Authorization) == 0 {
return fmt.Errorf("authorization is empty")
if err := d.validateAndInitCredentials(); err != nil {
return err
}

err := d.refreshToken()
if err != nil {
return err
Expand Down
6 changes: 5 additions & 1 deletion drivers/139/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ import (
)

type Addition struct {
Authorization string `json:"authorization" type:"text" required:"true"`
Authorization string `json:"authorization" type:"text" help:"Authorization can be used alone. If empty, use mail_cookies alone for fast login, or mail_cookies + username + password for full login fallback."`
Username string `json:"username" help:"Required only when using password login fallback with mail_cookies."`
Password string `json:"password" secret:"true" help:"Required only when using password login fallback with mail_cookies."`
MailCookies string `json:"mail_cookies" type:"text" help:"Cookies from mail.10086.cn. Can be used alone for fast login, or with username and password for full login fallback."`
driver.RootID
Type string `json:"type" type:"select" options:"personal_new,family,group,personal,share" default:"personal_new"`
CloudID string `json:"cloud_id"`
LinkID string `json:"link_id"`
UserDomainID string `json:"user_domain_id" help:"ud_id in Cookie, fill in to show disk usage"`
CustomUploadPartSize int64 `json:"custom_upload_part_size" type:"number" default:"0"`
ReportRealSize bool `json:"report_real_size" type:"bool" default:"true"`
UseLargeThumbnail bool `json:"use_large_thumbnail" type:"bool" default:"false"`
Expand Down
Loading