Skip to content

Commit

Permalink
Update driver.go
Browse files Browse the repository at this point in the history
  • Loading branch information
zengge99 authored Jun 18, 2024
1 parent 7b3669a commit abab8ad
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions drivers/quark_share/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
//"io"
"net/http"
"time"
"fmt"

"github.com/alist-org/alist/v3/drivers/base"
"github.com/alist-org/alist/v3/internal/driver"
Expand Down Expand Up @@ -39,11 +40,21 @@ func (d *QuarkShare) GetAddition() driver.Additional {

func (d *QuarkShare) Init(ctx context.Context) error {
_, err := d.request("/config", http.MethodGet, nil, nil)
d.getStoken()
stoken := d.getStoken()
if stoken == "" {
fmt.Println("刷新夸克分享令牌失败")
} else {
fmt.Println("刷新夸克分享令牌成功:", stoken)
}
d.linkMap = make(map[string]*model.Link)
d.cron = cron.NewCron(time.Hour * 2)
d.cron.Do(func() {
d.getStoken()
stoken := d.getStoken()
if stoken == "" {
fmt.Println("刷新夸克分享令牌失败")
} else {
fmt.Println("刷新夸克分享令牌成功:", stoken)
}
})
return err
}
Expand Down

0 comments on commit abab8ad

Please sign in to comment.