pcrbot / picfinder_take

hoshino bot搜图插件
44 stars 9 forks source link

ascii2d检索失败 #11

Closed ciriue closed 2 years ago

ciriue commented 2 years ago

这两天用ascii2d搜索突然不能用了,网页能正常使用

log输出也只有一个ERROR: ascii2d not found imageInfo

[2022-01-09 21:30:27,288 image] INFO: Loading Image Search Container…… [2022-01-09 21:30:27,290 image] DEBUG: Loading all view…… [2022-01-09 21:30:27,291 image] DEBUG: Now starting get the https://ascii2d.net/search/url/http://gchat.qpic.cn/gchatpic_new/0/0-0-7197F805341623A601F5EDB748EEE1F4/0?term=2 [2022-01-09 21:30:28,545 image] ERROR: ascii2d not found imageInfo

百分百复现

clacknya commented 2 years ago

ascii2d 用了 cloudflare 的机器人探测,用 py 请求会被阻断

ciriue commented 2 years ago

悲(

assassingyk commented 2 years ago

按说直接点链接能访问那应该还是能绕开的,request的时候加点什么header试试……实在不行试试selenium……

clacknya commented 2 years ago

可以参考 kitUIN/PicImageSearch#13

assassingyk commented 2 years ago

缝了下cloudscraper,应该能用了

ciriue commented 2 years ago

缝了下cloudscraper,应该能用了

大佬辛苦了

assassingyk commented 2 years ago

缝了cloudscraper的版本在windows端能用,linux就不行,很神秘……两边都是走的同一个梯子,按说也不会是ip问题

ciriue commented 2 years ago

缝了cloudscraper的版本在windows端能用,linux就不行,很神秘……两边都是走的同一个梯子,按说也不会是ip问题

然而windows端也得看运气,时灵时不灵

assassingyk commented 2 years ago

linux 端终于成功了……之前从来没看到过报错,偶然手动import了一次cloudscraper才发现之前一直失败是因为 CentOS 7 自带的 OpenSSL 版本1.0.2太低,必须升到>=1.1.1 的 OpenSSL 才能满足 cf 验证 TLS 1.3的要求。。。手动升级最新的OpenSSL 后再重新编译安装python就能正常使用了……

可以参考这个链接