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

修复 下载图片错误的问题 #307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GongXiaoBei77
Copy link

Copy link
Owner

@lich0821 lich0821 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

download_attach 不应该触发多次。这问题的根本原因在于,download_attach 的时候,图片消息还没入到数据库,查数据库的时候找不到消息 id。
简单的办法是收到消息后先做一点延时,再来处理。
不建议这么修。

Copy link

@markmeicd markmeicd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

首先申明我不清楚WCF的具体实现原理,只是谈谈我的困惑。我这边在微信不能自动下载文件/图片时,使用wcf.download_attach()或者是wcf.download_image()来主动下载图片的的时候,都会出现"Call FUNC_DOWNLOAD_ATTACH failed: Timed out"的错误。看了wcf日志,“
[2025-01-14 00:37:27.187] [debug] [WCF] [funcs.cpp::255::DownloadAttach] path:
[2025-01-14 00:37:27.187] [error] [WCF] [rpc_server.cpp::1041::RunServer] create_directory: 系统找不到指定的路径。: "
看了WCF项目的func.cpp的DownloadAttach方法的代码,仅仅在获取到正确的消息类型的时候save_path才会赋值,否则就是空,后续创建路径的时候就会出错。所以怀疑是类型获取错误。
我用的版本是39.3.3.2, 对应微信版本3.9.11.25

@markmeicd
Copy link

markmeicd commented Jan 13, 2025

download_attach 不应该触发多次。这问题的根本原因在于,download_attach 的时候,图片消息还没入到数据库,查数据库的时候找不到消息 id。 简单的办法是收到消息后先做一点延时,再来处理。 不建议这么修。

同项目主lich0821的看法。考虑到有些图片有点大,下载要花些时间,延时处理或者检查dat是否下载完成最好。另外,在下载Windows版不能自动下载图片大图时,dat文件保存路径是有的,在exrta信息里面,然后去下载的时候还是会报路径为空的错误。

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

Successfully merging this pull request may close these issues.

4 participants