From 0810561a8a59deecaff0eba2805a23d3f49f32a6 Mon Sep 17 00:00:00 2001 From: Xhofe Date: Mon, 18 Apr 2022 18:29:21 +0800 Subject: [PATCH 1/6] fix(xunlei): check err prevent stack overflow --- drivers/xunlei/xunlei.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/xunlei/xunlei.go b/drivers/xunlei/xunlei.go index 89440da0..2e9d4c23 100644 --- a/drivers/xunlei/xunlei.go +++ b/drivers/xunlei/xunlei.go @@ -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 { From cc96a5bbdbd01cb63293c402128074b6d60f13c3 Mon Sep 17 00:00:00 2001 From: Xhofe Date: Mon, 18 Apr 2022 18:31:10 +0800 Subject: [PATCH 2/6] chore: add windows bin to gitignore --- .gitignore | 1 + LICENSE | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ffbe096b..576dca8b 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ dist/ # vendor/ bin/* /alist +/alist.exe *.json public/*.html public/assets/ diff --git a/LICENSE b/LICENSE index 29ebfa54..0ad25db4 100644 --- a/LICENSE +++ b/LICENSE @@ -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 -. \ No newline at end of file +. From c276a1541f531519ac70c826f2f1e75da991bdfc Mon Sep 17 00:00:00 2001 From: Xhofe Date: Mon, 18 Apr 2022 18:32:29 +0800 Subject: [PATCH 3/6] chore: delete useless comment --- alist.go | 1 - public/public.go | 6 ------ 2 files changed, 7 deletions(-) diff --git a/alist.go b/alist.go index 9ad4601f..84514efa 100644 --- a/alist.go +++ b/alist.go @@ -12,7 +12,6 @@ import ( ) func Init() bool { - //bootstrap.InitLog() bootstrap.InitConf() bootstrap.InitCron() bootstrap.InitModel() diff --git a/public/public.go b/public/public.go index ff72043e..46319777 100644 --- a/public/public.go +++ b/public/public.go @@ -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 From 6612338fc1554f0075c2a002e793d48233421882 Mon Sep 17 00:00:00 2001 From: Xhofe Date: Wed, 20 Apr 2022 15:16:30 +0800 Subject: [PATCH 4/6] fix(189pc): InvalidSessionKey (fix #920) --- drivers/189pc/189.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/189pc/189.go b/drivers/189pc/189.go index a22f51be..b6f72f6b 100644 --- a/drivers/189pc/189.go +++ b/drivers/189pc/189.go @@ -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) } From 95c0106fdd2b3419f1ee7b4028f1bc9fe23a6d74 Mon Sep 17 00:00:00 2001 From: Xhofe Date: Wed, 20 Apr 2022 15:21:48 +0800 Subject: [PATCH 5/6] feat(onedrive): default redirect_uri(close #967) --- drivers/onedrive/driver.go | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/onedrive/driver.go b/drivers/onedrive/driver.go index dc498d64..09297293 100644 --- a/drivers/onedrive/driver.go +++ b/drivers/onedrive/driver.go @@ -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", From a7a0e85a465bf6577a4b6926305cf312337f717a Mon Sep 17 00:00:00 2001 From: Xhofe Date: Thu, 21 Apr 2022 22:31:17 +0800 Subject: [PATCH 6/6] docs: update qq group --- README.md | 2 +- README_cn.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f4235c97..5790c1f4 100755 --- a/README.md +++ b/README.md @@ -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) \ No newline at end of file +> [@Blog](https://nn.ci/) · [@GitHub](https://github.com/Xhofe) · [@TelegramGroup](https://t.me/alist_chat) · [@QQGroup](https://jq.qq.com/?_wv=1027&k=YJJj2Gwb) \ No newline at end of file diff --git a/README_cn.md b/README_cn.md index 0f53d366..69e8300e 100644 --- a/README_cn.md +++ b/README_cn.md @@ -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) \ No newline at end of file +> [@博客](https://nn.ci/) · [@GitHub](https://github.com/Xhofe) · [@Telegram群](https://t.me/alist_chat) · [@QQ群](https://jq.qq.com/?_wv=1027&k=YJJj2Gwb) \ No newline at end of file