alist-org / alist

🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。
https://alist.nn.ci
GNU Affero General Public License v3.0
42.46k stars 5.49k forks source link

Terabox 的 JsToken 会过期 #5277

Closed URenko closed 1 year ago

URenko commented 1 year ago

Please make sure of the following things

AList Version / AList 版本

v3.28.0

Driver used / 使用的存储驱动

Terabox

Describe the bug / 问题描述

配置好 Terabox (填入 Cookie 和 JsToken)后上传下载正常。 一天后下载正常,上传(需要 JsToken)错误:

[terabox] failed to precreate file, errno: %!s(int=4000023)

手动更新 JsToken 后可正常上传。

JsToken 可通过 https://www.terabox.com/home (应该要带Cookie) HTML获取:

<script>try {eval(decodeURIComponent(`function%20fn%28a%29%7Bwindow.jsToken%20%3D%20a%7D%3Bfn%28%22<JsToken>%22%29`)) } catch(ex) {console.log(ex);}</script>

Reproduction / 复现链接

N/A

Config / 配置

N/A

Logs / 日志

ERRO[2023-09-24 11:56:08]/source/internal/fs/fs.go:98 github.com/alist-org/alist/v3/internal/fs.PutDirectly() failed put /<name>/: [terabox] failed to precreate file, errno: %!s(int=4000023)
github.com/alist-org/alist/v3/internal/op.Put
        /source/internal/op/fs.go:578
github.com/alist-org/alist/v3/internal/fs.putDirectly
        /source/internal/fs/put.go:54
github.com/alist-org/alist/v3/internal/fs.PutDirectly
        /source/internal/fs/fs.go:96
github.com/alist-org/alist/v3/server/handles.FsStream
        /source/server/handles/fsup.go:63
github.com/gin-gonic/gin.(*Context).Next
        /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/alist-org/alist/v3/server/middlewares.FsUp
        /source/server/middlewares/fsup.go:43
github.com/gin-gonic/gin.(*Context).Next
        /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/alist-org/alist/v3/server/middlewares.Auth
        /source/server/middlewares/auth.go:67
github.com/gin-gonic/gin.(*Context).Next
        /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/alist-org/alist/v3/server/middlewares.StoragesLoaded
        /source/server/middlewares/check.go:14
github.com/gin-gonic/gin.(*Context).Next
        /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
        /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102
github.com/gin-gonic/gin.(*Context).Next
        /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.LoggerWithConfig.func1
        /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240
github.com/gin-gonic/gin.(*Context).Next
        /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
        /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
        /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
net/http.serverHandler.ServeHTTP
        /usr/local/go/src/net/http/server.go:2938
net/http.(*conn).serve
        /usr/local/go/src/net/http/server.go:2009
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1650 
welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the issue template!

eternity523523 commented 11 months ago

您好請問一下,關於JsToken「https://www.terabox.com/home 」這網址已經進不去了,我從Terabox首頁進去找原始碼,有看到這一段,但貼進去JsToken仍是無法上傳檔案,請問該如何更新JsToken呢?

URenko commented 11 months ago

看了下现在在 https://www.terabox.com/<语言>/main, 或许取 https://www.terabox.com 302 到的最终地址更为稳定

eternity523523 commented 11 months ago

302是指轉向嗎,它目前會轉到https://www.terabox.com/main?category=all,我在裡面有找到以下這段,但貼進去JsToken仍是無法上傳,請問是不是要作什麼修改?

URenko commented 11 months ago

你确认你取的是以上中的 54AF23B5094D82DFDEAE5A2B15655170FC66E98BF7B1FA088794B4EA47899CBDBCC9F1B84BBF91781D0DAD98A5246E651B8B62329B73BDC298128442C3925734 吗?即两个%22之间的内容

不过既然是手动更新,从 cookie 复制可能更快?

我这自动更新的 JsToken 没出问题

eternity523523 commented 11 months ago

可以了~!!我還以為是 Githubissues.

  • Githubissues is a development platform for aggregating issues.