神代綺凛

[开源] 二次元搜图QQ机器人
因酷Q停止运营,本项目已转为依赖 go-cqhttp R.I.P. CoolQ
扫描右侧二维码阅读全文
13
2018/07

[开源] 二次元搜图QQ机器人

因酷Q停止运营,本项目已转为依赖 go-cqhttp

R.I.P. CoolQ

Head Pic: 「第六駆逐隊」/「ふわり」のイラスト [pixiv]

搜图机器人

QQ:*

抱歉,因各种复杂的原因,本体已经转为私用,现已不再公开允许加好友或群,有兴趣可自行部署玩耍

开源

项目最初是使用酷Q的易语言 SDK 开发,后使用 Node.js 重写并开源

开源版本不含咬人功能,因为懒得移植了……

用法及功能

请见 GitHub README 以及 wiki

示例

普通搜图

利用 ascii2d 搜索局部图

搜番

搜本子

搬瓦工VPS优惠套餐,建站稳如狗,支持支付宝,循环出账94折优惠码BWH3HYATVBJW
年付$47CN2线路,1核/1G内存/20G硬盘/1T@1Gbps【点击购买
季付$47CN2 GIA线路,1核/1G内存/20G硬盘/1T@2.5Gbps【点击购买
Last modification:July 21st, 2022 at 10:15 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment Cancel reply

667 comments

  1. 真央  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 63.0.3239.26(Google Chrome 63.0.3239.26)
    该评论仅登录用户及评论双方可见
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @真央 这类功能已经在计划中了 闲来无事的时候就会更新
  2. Pinkiesoft  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 63.0.3239.132(Google Chrome 63.0.3239.132)
    想要竹竹入群(哭)
  3. sanqian  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 70.0.3538.110(Google Chrome 70.0.3538.110)
    博主大大,按照githun上的部署后不能正常使用,log日志显示PM连接失败
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @sanqian 贴一下日志内容
      1. sanqian  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 70.0.3538.110(Google Chrome 70.0.3538.110)
        @神代綺凜
        该评论仅登录用户及评论双方可见
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
          @sanqian cqhttp插件没配置好,检查是不是use_wstrue或者改了配置没重启插件等问题
          1. sanqian  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 70.0.3538.110(Google Chrome 70.0.3538.110)
            @神代綺凜 确定是true,而且我重启了整个酷Q
            1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
              @sanqian 那就不清楚还有什么问题了……只能靠你自己排查了
              1. sanqian  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 70.0.3538.110(Google Chrome 70.0.3538.110)
                @神代綺凜 好吧,谢谢大佬
  4. Miyako  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 69.0.3497.100(Google Chrome 69.0.3497.100)
    哭了,完全不懂的我从早上一直弄到下午,弄好了却发现搜图一直是服务器爆炸QAQ,大佬这个应该怎么解决
    1. Miyako  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 69.0.3497.100(Google Chrome 69.0.3497.100)
      @Miyako 2019-1-28 16:59:22 [error] saucenao[0]
      Error: read ECONNRESET
      搜图报的是这个错
      1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
        @Miyako 应该是在国内机子上部署的吧,网络不好无法访问 saucenao.com
        1. Miyako  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 49.0.2623.87(Google Chrome 49.0.2623.87)
          @神代綺凜 那么再请教下大佬,机子可不可以通过挂小飞机全局代理来实现访问saucenao呢
          1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
            @Miyako 只是系统 HTTP 代理的话不能代理 Nodejs 流量,关于这个我下个版本再更新代理设置方法吧
            1. Miyako  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 69.0.3497.100(Google Chrome 69.0.3497.100)
              @神代綺凜 好的,坐等下个版本 大佬nb(破音)!!
  5. Effervescence  Android 8.1.0(Android 8.1.0) / Google Chrome 71.0.3578.99(Google Chrome 71.0.3578.99)
    大佬能不能帮我搭建一下,我自己尝试了一下,发现不论发什么都没反应。
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @Effervescence 当然不能
  6. Paulzzh  Android 8.0.0(Android 8.0.0) / Google Chrome 71.0.3578.99(Google Chrome 71.0.3578.99)
    竹竹生日快乐(?)|´・ω・)ノ
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @Paulzzh 是哇 原来已经过了一年了
  7. 想吃狐萝卜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
    请教一下,想把自己的也弄得像竹竹一样,那么该如果添加新的命令呢(--help这种),而且竹竹回复带图好羡慕,请问格式是什么呢,以及whatanime的Cookie分割符是英文的“,”嘛
    1. 神代綺凜  Mac OS X(Mac OS X) / Safari(Safari)
      @想吃狐萝卜 单纯的对指定关键字回复直接用酷q的语言库就行了
      第二个问题没明白意思。。
      多个 cookie 按 json 数组形式填写
  8.   Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
    请教一下,setu显示图片延迟有点大一般是什么原因造成的啊,有时候链接已经出来了图片却迟迟不显示,然后这期间私聊机器人也不会自动回复(会在发出图片的那一瞬间全部回复出来),和本地网络有关么,挂酸酸乳会不会好一点呢?
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @枫 正常,因为你接收聊天图片也要时间……
      1.   Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
        @神代綺凜 发现不光是图片,时间长了整个响应时间都变长了,只能任务管理器结束进程(因为命令重启提示cqpf进程不存在),但是期间塔塔露响应并没有问题。
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
          @枫 如果是网络原因的话……比较建议用国外VPS挂,否则setu下载速度和saucenao都会很慢
  9. 零之虚空  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
    哪个 竹竹的密码是啥?
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @零之虚空 文章里都有答案的
  10. cakeyui  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
    必须部署在winserver上的吗。。因为好像发现 酷Q没有linux版?
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @cakeyui linux 上可以用 Docker 版,不过体验很差而且问题很多,不推荐
      1. 潆凉ヽ如梦  Windows 8.1 x64 Edition(Windows 8.1 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
        @神代綺凜 请问可以用wine吗,我想试试能不能在我家树莓派上跑,但是Docker版有点问题
        1. 神代綺凜  Mac OS X(Mac OS X) / Safari(Safari)
          @潆凉ヽ如梦 我试过不行,cqhttp 插件依赖 vc++ 运行库,在 wine 上会有莫名其妙的问题……
  11. jjhjy589  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 63.0.3239.132(Google Chrome 63.0.3239.132)
    为何被删好友了
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @jjhjy589 重加就好,陌生人列表爆了导致一些问题所以清理了
  12. pushMIKU  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 71.0.3578.80(Google Chrome 71.0.3578.80)
    私聊给竹竹怎么没反应了= =
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @pushMIKU 如果是发图没反应就尝试二次截图再发送,因为有些图片可能因为敏感原因被tx屏蔽
    2. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @pushMIKU 我这正常,并没有问题
      1. C.C.  Android 8.1.0(Android 8.1.0) / Google Chrome 68.0.3440.91(Google Chrome 68.0.3440.91)
        @神代綺凜 我发什么都没有任何反应。。。
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
          @C.C. 这就不清楚了……
  13. 胶水与番茄酱  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 63.0.3239.132(Google Chrome 63.0.3239.132)
    emm...请问一下博主,我用手机和电脑这几天一直在发同一张图,结果说服务器爆炸,是不是ip问题呢
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @胶水与番茄酱 如果是某张图怎么搜都爆炸,就尝试把图片点开截图一次(范围仍是整张图),再发过去
      有些图来源有问题会得不到在线链接,二次截图的目的是改变图片Hash
      1. 胶水与番茄酱  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 63.0.3239.132(Google Chrome 63.0.3239.132)
        @神代綺凜 谢谢,已经解决(ฅ´ω`ฅ)
  14. 青いほしぞら  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
    请问一下博主CoolQ HTTP API怎么配置,pm2 restart cqpf没反应,而npm start报端口错QAQ
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @青いほしぞら 因为有错误所以pm2无法守护
      CoolQ HTTP API 配置文件要把use_ws改成true,除此之外没什么需要改的了,这点我好像忘记写了_(:3」∠)_
      1. 青いほしぞら  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
        @神代綺凜 然后还想问一下,默认的config.json用的是6700端口,可是npm start报了Error: listen EADDRINUSE :::60233 错...
        1. 神代綺凜  Mac OS X(Mac OS X) / Safari(Safari)
          @青いほしぞら 唔你是不是重复运行了这个程序没完全关掉,因为之前改了一下setu功能,默认监听60233端口用于本地反代下载p站图片,如果实在冲突的话可以改这一行

          https://github.com/Tsuk1ko/CQ-picfinder-robot/blob/434b8ca0997aa7f1f8a00a6f6ed9efc08c525153/modules/plugin/setu.js#L38

          1.   Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
            @神代綺凜 请问我用NGINX反代可以上P,那么我是不是也需要把setu的38行的端口也改成80啊?(因为反代后浏览器能上P,--setu却刷不出图了)
            1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
              @枫 不需要改这个端口,并且这个端口是指定本地反代监听端口,不可以和已有端口冲突
              这个本地反代的用途是下载图片的时候加上 referer 的 header 以绕过p站的防盗链措施,原图域名是 i.pximg.net,该域名并没有被 sni 阻断,是可以直连的
              刷不出图可能是网络问题,图片下载过慢之类的,因此建议在境外 VPS 部署
          2. 青いほしぞら  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
            @神代綺凜 不知道怎么倒腾的,重新clone了几次就好了/Facepalm,多谢博主ʬʬ
            1. 神代綺凜  Mac OS X(Mac OS X) / Safari(Safari)
  15. shigure  Android 7.1.2(Android 7.1.2) / zBrowser 7.4.1(zBrowser 7.4.1)
    博博请问现在怎么把竹竹拉进群啊,我在别的群看到有竹竹是真滴羡慕。
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.80(Google Chrome 71.0.3578.80)
      @shigure 已经不再允许加群,想玩可以自己部署
      1. shigure  Android 7.1.2(Android 7.1.2) / zBrowser 7.4.1(zBrowser 7.4.1)
        @神代綺凜 自己部署的意思是?
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.80(Google Chrome 71.0.3578.80)
          @shigure 如你所见,这个机器人已经开源了,如果你或者你的朋友懂得部署nodejs项目,可以自行搭建这个机器人
          1. shigure  Android 7.1.2(Android 7.1.2) / zBrowser 7.4.1(zBrowser 7.4.1)
            @神代綺凜 好的,谢谢博博了。博博做的竹竹真的好评,很喜欢,以后如果能再加群或者有新的机器人请务必留我一份【开玩笑的】2333
            1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.80(Google Chrome 71.0.3578.80)
              @shigure 感谢支持
  16. Cofalt  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 53.0.2785.104(Google Chrome 53.0.2785.104)
    感谢博主的机器人,简直是非常实用的发明.

    赞美之心|´・ω・)ノ

    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 70.0.3538.110(Google Chrome 70.0.3538.110)
      @Cofalt 感谢支持
  17. 真央  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 63.0.3239.26(Google Chrome 63.0.3239.26)
    该评论仅登录用户及评论双方可见
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 70.0.3538.110(Google Chrome 70.0.3538.110)
      @真央 这个是在发送搜图结果的时候是否用文字而不用分享,不是pro自然要true,pro的话有时候如果出现分享发的太多被屏蔽的情况也可以true

      另外有一些机制我还没有设计完全目前程序有点乱……当时没开多一个分支,readme也没更新,如果要更新的话先等一阵子吧

      更新的话直接git pullnpm i,然后根据新增的配置内容修改自己的config就行

      1. 真央  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 63.0.3239.26(Google Chrome 63.0.3239.26)
        @神代綺凜 好的非常感谢|´・ω・)ノ
  18. dMinor  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 69.0.3497.81(Google Chrome 69.0.3497.81)
    该评论仅登录用户及评论双方可见
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 70.0.3538.110(Google Chrome 70.0.3538.110)
      @dMinor 也被举报?
      1. dMinor  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 69.0.3497.81(Google Chrome 69.0.3497.81)
        @神代綺凜 呆胶布,只是我们自己把群搞炸了(天知道是内鬼还是算法),新群木有竹竹van了好寂寞嘤嘤嘤(/ω\),然后就来发发牢骚,最近查的是真的严= =
  19. 猫宫Azusa  Windows 10 x64 Edition(Windows 10 x64 Edition) / uBrowser 6.2.4094.1(uBrowser 6.2.4094.1)
    难怪这几天没反应了…早就有预感会被举报啥的…
    话说搜gif的时候whatanime总是会说文件太大是无法解决的吧?
    1. 神代綺凜  Mac OS X(Mac OS X) / Safari(Safari)
      @猫宫Azusa 嗯,实际上whatanime是不支持gif的,要搜的话建议截一帧出来搜
  20. shanai  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 69.0.3497.100(Google Chrome 69.0.3497.100)
     DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

    在群里搜图 只有精确度的回复 并没有图片链接 并且 log 中出现此警告 是什么原因呢(╯‵□′)╯︵┴─┴

    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 70.0.3538.102(Google Chrome 70.0.3538.102)
      @shanai 这个警告可以无视

      没有图片链接是每次都有这个情况?