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

下载附件超过64k数据不全问题 #24

Open
1988yekai opened this issue Feb 26, 2025 · 1 comment
Open

下载附件超过64k数据不全问题 #24

1988yekai opened this issue Feb 26, 2025 · 1 comment

Comments

@1988yekai
Copy link

tool工具下载超过64k的附件下载不全
async def download_attach(self, attach_id: str) -> dict:
"""下载附件。

    Args:
        attach_id (str): 附件ID

    Returns:
        dict: 附件数据

    Raises:
        UserLoggedOut: 未登录时调用
        根据error_handler处理错误
    """
    if not self.wxid:
        raise UserLoggedOut("请先登录")

    async with aiohttp.ClientSession() as session:
        json_param = {"Wxid": self.wxid, "AttachId": attach_id}
        response = await session.post(f'http://{self.ip}:{self.port}/DownloadAttach', json=json_param)
        print(f'http://{self.ip}:{self.port}/DownloadAttach')
        json_resp = await response.json()
        print(json.dumps(json_resp))
        if json_resp.get("Success"):
            return json_resp.get("Data").get("data").get("buffer")
        else:
            self.error_handler(json_resp)

返回的data中的buffer只有64k数据
"totalLen": 197220, "startPos": 0, "dataLen": 65536, "data": {"iLen": 65536, "buffer": ""}

@1988yekai
Copy link
Author

Image

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

1 participant