Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

求救! #3

Open
saxiaoju opened this issue Jan 3, 2025 · 16 comments
Open

求救! #3

saxiaoju opened this issue Jan 3, 2025 · 16 comments

Comments

@saxiaoju
Copy link

saxiaoju commented Jan 3, 2025

运行报错,这如何解决?
C:\Users\Administrator\Desktop\saveany-bot-v0.4.3-windows-amd64>saveany-bot
[2025/01/03T17:24:25.081] [SaveAnyBot] [INFO] [init.go:15,InitAll] Running...
[2025/01/03T17:24:25.086] [SaveAnyBot] [DEBUG] [storage.go:26,Init] Initializing storage...
[2025/01/03T17:24:25.102] [SaveAnyBot] [DEBUG] [alist.go:84,Init] Logged in to Alist
[2025/01/03T17:24:25.109] [SaveAnyBot] [DEBUG] [storage.go:46,Init] Storage initialized
[2025/01/03T17:24:25.110] [SaveAnyBot] [DEBUG] [db.go:27,Init] Database connected
[2025/01/03T17:24:25.113] [SaveAnyBot] [INFO] [bot.go:18,Init] Initializing client...
[2025/01/03T17:25:25.115] [SaveAnyBot] [FATAL] [bot.go:43,Init] Failed to initialize client: timeout

@krau
Copy link
Owner

krau commented Jan 3, 2025

你本地到tg服务器的网络不太好吗

@saxiaoju
Copy link
Author

saxiaoju commented Jan 3, 2025

全局代理,其他网站都正常,tg也能正常登录

@krau
Copy link
Owner

krau commented Jan 3, 2025

全局代理,其他网站都正常,tg也能找出登录

贴一下配置文件

Repository owner deleted a comment from saxiaoju Jan 3, 2025
@krau
Copy link
Owner

krau commented Jan 3, 2025

换一下 app id hash, 用你提供的配置提示 rpc error code 400: API_ID_INVALID
另外注意保护secret, 帮你把回复删了

全局代理,其他网站都正常,tg也能找出登录

@saxiaoju
Copy link
Author

saxiaoju commented Jan 3, 2025

我发出来这个是改过相关secret,你是需要我没改过的原始配置么?这边运行就提示Failed to initialize client: timeout
截屏

@saxiaoju
Copy link
Author

saxiaoju commented Jan 3, 2025

换一下 app id hash, 用你提供的配置提示 rpc error code 400: API_ID_INVALID 另外注意保护secret, 帮你把回复删了

全局代理,其他网站都正常,tg也能正常登录

截图3

同样的配置,这是日本服务器运行的情况

@krau
Copy link
Owner

krau commented Jan 3, 2025

换一下 app id hash, 用你提供的配置提示 rpc error code 400: API_ID_INVALID 另外注意保护secret, 帮你把回复删了

全局代理,其他网站都正常,tg也能正常登录

截图3

同样的配置,这是日本服务器运行的情况

那看来是你的代理配置的问题,如果你是使用 clash/v2ray 等代理客户端,可以开启 tun 模式接管所有流量。
后续版本应该会加上适配系统代理设置

@saxiaoju
Copy link
Author

saxiaoju commented Jan 3, 2025

服务器虽然运行起来了,但是把文件转到tg机器人,文件不会上传到alist网盘里面,
我的alist配置
[storage]
[storage.alist] # Alist
enable = true
base_path = "/telegram" # 保存路径
username = "admin" # 用户名
password = "xhtdevil" # 密码
url = "http://localhost:5244" # Alist 地址
token_exp = 86400 # token 过期时间, 单位: 秒

[storage.local] # 本地磁盘
enable = true
base_path = "downloads/" # 保存路径

[storage.webdav] # WebDav
enable = true
base_path = "/telegram"
username = "admin"
password = "xhtdevil"
url = "http://localhost:5244/dav"
运行报错日志
2025/01/03T22:40:23.164] [SaveAnyBot] [TRACE] [core.go:42,func1] Downloading [987345144:137]:My-cronds.zip: 100.00%
[2025/01/03T22:40:26.391] [SaveAnyBot] [ERROR] [webdav.go:49,Save] Failed to write file /telegram/My-cronds.zip: WriteStream /telegram/My-cronds.zip: 405
[2025/01/03T22:40:26.392] [SaveAnyBot] [DEBUG] [os.go:28,RmFileAfter] Remove file after 33m20s: cache/My-cronds.zip
[2025/01/03T22:40:26.392] [SaveAnyBot] [ERROR] [core.go:120,worker] Failed to do task: Failed to save file: webdav: failed to write file
报错405,这是不能采用http么?

@krau
Copy link
Owner

krau commented Jan 3, 2025

Failed to save file: webdav: failed to w

没能复现, 可能是 alist 对 webdav 的处理的问题. 我这边用的是 OneDrive 驱动.
可以试下保存位置时选择 alist 而非 alist 提供的 webdav

ref

AlistGo/alist#1751
AlistGo/alist#3621

@saxiaoju
Copy link
Author

saxiaoju commented Jan 3, 2025

Failed to save file: webdav: failed to w

没能复现, 可能是 alist 对 webdav 的处理的问题. 我这边用的是 OneDrive 驱动. 可以试下保存位置时选择 alist 而非 alist 提供的 webdav

ref

AlistGo/alist#1751 AlistGo/alist#3621

我用alist的时候提示成功,但是网盘内没有找到相关文件,用alist提供的web提示405,但是用该脚本下载到服务器,再用rclone利用alist的webdav能正常上传、同步,现在我就是先下载到服务器然后定时利用rclone上传

@saxiaoju
Copy link
Author

saxiaoju commented Jan 7, 2025

0.4.4版本可以使用webdav上传了,但是偶尔会触发保存不成功,再次转存或者三次转存才能成功,是否能增加判断如果保存不成功的话,尝试再次保存!能否增加tg代理,类似下图
Screenshot_2025-01-04-12-29-16-238_com lemurbrowser exts-edit

@krau
Copy link
Owner

krau commented Jan 7, 2025

v0.4.4并没有更改webdav相关代码, 转存失败时bot日志发一下

@krau
Copy link
Owner

krau commented Jan 7, 2025

@saxiaoju
Copy link
Author

saxiaoju commented Jan 7, 2025

v0.4.4并没有更改webdav相关代码, 转存失败时bot日志发一下

报错
因为清理过日志,我只找到这个,这个好像是下载报错的,再次转存可以正常下载并保存

@saxiaoju
Copy link
Author

saxiaoju commented Jan 7, 2025

v0.4.4并没有更改webdav相关代码, 转存失败时bot日志发一下

有考虑添加代理么?谢谢您的及时回复及更新

@krau
Copy link
Owner

krau commented Jan 7, 2025

v0.4.4并没有更改webdav相关代码, 转存失败时bot日志发一下

有考虑添加代理么?谢谢您的及时回复及更新

v0.5.0 已经添加了代理配置和任务转存重试, 查看 https://github.com/krau/SaveAny-Bot/blob/main/config.example.toml
代理暂只支持 socks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants