Skip to content

Commit

Permalink
chore: Merge pull request #984 from Xhofe/dev
Browse files Browse the repository at this point in the history
2.4.2
  • Loading branch information
xhofe authored Apr 21, 2022
2 parents 82a5c43 + a7a0e85 commit 56b3b35
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dist/
# vendor/
bin/*
/alist
/alist.exe
*.json
public/*.html
public/assets/
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -658,4 +658,4 @@ specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ The `AList` is open-source software licensed under the AGPL-3.0 license.

---

> [@Blog](https://nn.ci/) · [@GitHub](https://github.com/Xhofe) · [@TelegramGroup](https://t.me/alist_chat) · [@QQGroup](https://jq.qq.com/?_wv=1027&k=OVPJcv2b)
> [@Blog](https://nn.ci/) · [@GitHub](https://github.com/Xhofe) · [@TelegramGroup](https://t.me/alist_chat) · [@QQGroup](https://jq.qq.com/?_wv=1027&k=YJJj2Gwb)
2 changes: 1 addition & 1 deletion README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@

---

> [@Blog](https://nn.ci/) · [@GitHub](https://github.com/Xhofe) · [@TelegramGroup](https://t.me/alist_chat) · [@QQGroup](https://jq.qq.com/?_wv=1027&k=OVPJcv2b)
> [@博客](https://nn.ci/) · [@GitHub](https://github.com/Xhofe) · [@Telegram](https://t.me/alist_chat) · [@QQ](https://jq.qq.com/?_wv=1027&k=YJJj2Gwb)
1 change: 0 additions & 1 deletion alist.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
)

func Init() bool {
//bootstrap.InitLog()
bootstrap.InitConf()
bootstrap.InitCron()
bootstrap.InitModel()
Expand Down
7 changes: 7 additions & 0 deletions drivers/189pc/189.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,13 @@ func (s *State) Request(method string, fullUrl string, params Params, callback f
return nil, fmt.Errorf(erron.Msg)
}
if erron.ErrorCode != "" {
switch erron.ErrorCode {
case "InvalidSessionKey":
if err := s.RefreshSession(account); err != nil {
return nil, err
}
return s.Request(method, fullUrl, params, callback, account)
}
return nil, fmt.Errorf(erron.ErrorMsg)
}

Expand Down
1 change: 1 addition & 0 deletions drivers/onedrive/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (driver Onedrive) Items() []base.Item {
Label: "redirect uri",
Type: base.TypeString,
Required: true,
Default: "https://tool.nn.ci/onedrive/callback",
},
{
Name: "refresh_token",
Expand Down
12 changes: 9 additions & 3 deletions drivers/xunlei/xunlei.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,18 @@ func (s *State) Request(method string, url string, callback func(*resty.Request)
log.Debug(res.String())

var e Erron
utils.Json.Unmarshal(res.Body(), &e)
err = utils.Json.Unmarshal(res.Body(), &e)
if err != nil {
return nil, err
}
switch e.ErrorCode {
case 9:
s.newCaptchaToken(getAction(method, url), nil, account)
_, err = s.newCaptchaToken(getAction(method, url), nil, account)
if err != nil {
return nil, err
}
fallthrough
case 4122, 4121:
case 4122, 4121: // Authorization expired
return s.Request(method, url, callback, account)
case 0:
if res.StatusCode() == http.StatusOK {
Expand Down
6 changes: 0 additions & 6 deletions public/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@ import "embed"

//go:embed *
var Public embed.FS

////go:embed index.html
//var Index embed.FS
//
////go:embed assets/**
//var Assets embed.FS

0 comments on commit 56b3b35

Please sign in to comment.