koishijs / koishi-plugin-image-search

图片搜索,支持 saucenao, ascii2d 等多个平台
MIT License
10 stars 6 forks source link

由于未知原因搜索失败。 #20

Closed lizard0126 closed 1 month ago

lizard0126 commented 11 months ago

在QQ中和koishi的沙盒中均如此 图片 图片 日志如下 图片

eric2788 commented 11 months ago

我也是

MaikoTan commented 11 months ago

Will you also encounter this problem with a much smaller image? Since the log clearly pointed out that your image is too big.

如果图像小得多,您也会遇到这个问题吗?由于日志明确指出您的图像太大。

MaikoTan commented 11 months ago

Looks like #19 is the same problem as this one, I will try to dig it in days. Thanks for the reporting.

看起来 #19 和这个是同样的问题,我会试着在几天内找到它。谢谢你的报道。

lizard0126 commented 11 months ago

Will you also encounter this problem with a much smaller image? Since the log clearly pointed out that your image is too big.

如果图像小得多,您也会遇到这个问题吗?由于日志明确指出您的图像太大。

是的,经过压缩后的图片仍然显示同样的代码

TeoZler commented 11 months ago

在使用telegram适配器时出现同样的错误。 相同的图片在使用discord适配器时可以正常搜索。 {B01A6109-2451-463c-B1FA-1DBC43F0FDDF} {64417BDD-0733-4fce-9778-566A7D9F8307} {12938F32-71B0-419b-BE28-A3EC14D20A69}

shigma commented 11 months ago

我有个猜测,就是 dc 的图片是 dc 的 cdn 链接,其他平台都是 data url。而 data url 就会触发 414。

所以本质上是必须把图片部署到公网才能搜索。

如果是这样的话那就比较麻烦了,要么要求开搜图功能的设备都接入公网,要么就需要找到临时公网部署的服务来中转图片。

MaikoTan commented 11 months ago

所以本质上是必须把图片部署到公网才能搜索。

如果是这样的话那就比较麻烦了,要么要求开搜图功能的设备都接入公网,要么就需要找到临时公网部署的服务来中转图片。

Since you could upload an image file to search by in the saucenao or ascii2d or any others, maybe we could dig out the upload API and then make it pretend to be a browser.

For example, in ascii2d.net you could construct a POST request to https://ascii2d.net/search/file with the body data in form data type including file the image binary and authenticity_token the CSRF token, then wait for the server give you a 302 redirect location to get the webpage and Bob's your uncle.

既然你可以上传一个图像文件来在 Sausenao 或 ascii2d 或任何其他中搜索,也许我们可以挖掘上传 API,然后让它假装成一个浏览器。

例如,在 ascii2d.net 中,您可以构造一个对https://ascii2d.net/search/file的 POST 请求,其中的正文数据采用表单数据类型,包括file图像二进制文件和authenticity_tokenCSRF 令牌,然后等待服务器给你一个 302 重定向位置来获取网页,鲍勃是你的叔叔。

idranme commented 4 months ago

29 应该解决了该问题