神代綺凛

[开源] 二次元搜图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. NekoMiao  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 75.0.3770.80(Google Chrome 75.0.3770.80)
    大大可以帮忙看看为什么明日方舟文字的识别没成功吗,确认api key是没问题的了

            "ocr": {
                "use": "baidubce", 
                "ocr.space": {
                    "defaultLANG": "chs",
                    "apikey": "xx"
                },
                "baidubce": {
                    "useApi": "accurate_basic",
                    "apiKey": "xx",
                    "secretKey": "xxx"
                }
            },
    
            "akhr": {
                "enable": true,   
                "ocr": "baidubce"  
            }
        },
    日志:
    0|cqpf     |         res: [IncomingMessage],
    0|cqpf     |         aborted: undefined,
    0|cqpf     |         timeoutCb: null,
    0|cqpf     |         upgradeOrConnect: false,
    0|cqpf     |         parser: null,
    0|cqpf     |         maxHeadersCount: null,
    0|cqpf     |         _redirectable: [Writable],
    0|cqpf     |         [Symbol(isCorked)]: false,
    0|cqpf     |         [Symbol(outHeadersKey)]: [Object] },
    0|cqpf     |      data: 'The API key is invalid' } }
    0|cqpf     | Fontconfig warning: "/etc/fonts/fonts.conf", line 86: unknown element "blank"
    0|cqpf     | Fontconfig warning: "/etc/fonts/fonts.conf", line 86: unknown element "blank"
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 75.0.3770.80(Google Chrome 75.0.3770.80)
      @NekoMiao 如果有对配置进行修改的话要重启程序才能生效,有没有忘记重启之类的
      1. NekoMiao  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 75.0.3770.80(Google Chrome 75.0.3770.80)
        @神代綺凜 重启以后依旧不行
        qq没有任何消息返回
        日志:

         method: 'GET',
                path:
                 '/offpic_new/00000//3629d1ea-4ff9-43fb-ae1f-ea73c69cf65a/0?vuin=00000&term=2',
                _ended: false,
                res: null,
                aborted: undefined,
                timeoutCb: null,
                upgradeOrConnect: false,
                parser: null,
                maxHeadersCount: null,
                _redirectable: [Circular],
                [Symbol(isCorked)]: false,
                [Symbol(outHeadersKey)]: [Object] },
             _currentUrl:
              'https://c2cpicdw.qpic.cn/offpic_new/00000//3629d1ea-4ff9-43fb-ae1f-ea73c69cf65a/0?vuin=00000&term=2' },
          response: undefined }
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 75.0.3770.80(Google Chrome 75.0.3770.80)
          @NekoMiao 这个问题比较莫名,我曾经只遇到过一次,过一会又会正常,是对应的图片下载失败了

          建议尝试重新截图

          还有你这个图片截的挺糊的……而且鼠标挡住文字会影响识别

          1. NekoMiao  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 75.0.3770.80(Google Chrome 75.0.3770.80)
            @神代綺凜 结果回复了一个奇怪的东西
            图片地址http://chuantu.xyz/t6/702/1560439457x1033347913.png
            日志多了一行:
            0|cqpf | Fontconfig warning: "/etc/fonts/fonts.conf", line 86: unknown element "blank"
            1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 75.0.3770.80(Google Chrome 75.0.3770.80)
              @NekoMiao 我绘制 Canvas 时要用到微软雅黑字体,可能是因为你使用的 linux 中没有这个字体的原因

              比较建议用 Windows 服务器,毕竟酷Q也是 Windows 程序,Docker 版用 Wine 来虚拟 Win 环境始终是有弊端的

              1. NekoMiao  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 75.0.3770.80(Google Chrome 75.0.3770.80)
                @神代綺凜 好的 谢谢大佬了
            2. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 75.0.3770.80(Google Chrome 75.0.3770.80)
              @NekoMiao 好像是你前面字体的问题

              0|cqpf     | Fontconfig warning: "/etc/fonts/fonts.conf", line 86: unknown element "blank"

              你可以百度一下看看是什么原因

  2. 天真  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 70.0.3538.25(Google Chrome 70.0.3538.25)
    该评论仅登录用户及评论双方可见
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 75.0.3770.80(Google Chrome 75.0.3770.80)
      @天真
      该评论仅登录用户及评论双方可见
      1. 天真  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 70.0.3538.25(Google Chrome 70.0.3538.25)
        @神代綺凜 谢谢 已经解决
  3. Kurt Tighe  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 76.0.3803.0(Google Chrome 76.0.3803.0)
    额 ,⑧嗦了,输入法的锅,(捂脸
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 74.0.3729.169(Google Chrome 74.0.3729.169)
      @Kurt Tighe 所以是解决了是么
      那一大段报错就前面JSON.parse()是重点,你在编辑的时候肯定把 JSON 格式破坏了
      1. Kurt Tighe  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 76.0.3803.0(Google Chrome 76.0.3803.0)
        @神代綺凜 是的,系统输入法莫名变成了中文字符
        1. Kurt Tighe  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 76.0.3803.0(Google Chrome 76.0.3803.0)
          @Kurt Tighe 然后,中文逗号)吐血
          1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 74.0.3729.169(Google Chrome 74.0.3729.169)
  4. 变态鹅  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 74.0.3729.157(Google Chrome 74.0.3729.157)
    草,居然还有瑟图
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 74.0.3729.157(Google Chrome 74.0.3729.157)
      @变态鹅 瑟图不能少
  5. 画个圈跳出去  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 74.0.3729.131(Google Chrome 74.0.3729.131)
    我觉得可以把返回的消息整合一下,不然一次回太多容易刷屏
  6. 奶爸de笔记  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 74.0.3729.108(Google Chrome 74.0.3729.108)
    表示老了,不懂二次元。 ̄﹃ ̄
  7. 高冷  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 70.0.3538.25(Google Chrome 70.0.3538.25)
    该评论仅登录用户及评论双方可见
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 74.0.3729.108(Google Chrome 74.0.3729.108)
      @高冷
      该评论仅登录用户及评论双方可见
      1. 高冷  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 70.0.3538.25(Google Chrome 70.0.3538.25)
        @神代綺凜 已经更新了的 发现之前不知道什么时候不小心改动了一下config.default.json导致没完成更新 没注意到 感谢⌇●﹏●⌇
  8. 弱骨  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 74.0.3729.108(Google Chrome 74.0.3729.108)
      @弱骨 该机器人已经转为私用,不再开放给陌生人使用,抱歉了
  9. 語冰  Windows 10 x64 Edition(Windows 10 x64 Edition) / Vivaldi 2.4.1488.38(Vivaldi 2.4.1488.38)
    酷Q Air不能發圖片就調了一個QQLight版本的,
    但是SauceNao的縮略圖發送好像都會有問題,
    發送緩慢,還常常破圖,
    明明setu的圖片都蠻順的
    酷Q有這問題嗎?

    另外試著搞了一下Ascii2d,
    是不是有使用頻率限制?後面都get不到東西

    1. 狮子堂戌子  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 74.0.3729.169(Google Chrome 74.0.3729.169)
      @語冰 用vps折腾了一下午 发现docker是莫得QQLight。看来只能酷q凑合玩玩了
    2. 狮子堂戌子  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 74.0.3729.169(Google Chrome 74.0.3729.169)
      @語冰 请问如何弄QQLight版本?按照博主的教程弄了酷q版本,不能发图感觉还是差了点什么
    3. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 73.0.3683.103(Google Chrome 73.0.3683.103)
      @語冰 我在大陆外机子上部署的,没有遇到破图问题,可能是你本地网络到 saucenao 不畅

      Ascii2d 我没有整合进去使用所以不了解情况

  10. Mr--冷眸  Android 8.0.0(Android 8.0.0) / Opera 4.0(Opera 4.0)
    这个机器人真的流啤|´・ω・)ノ
  11. STon3Dr3Am  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 73.0.3683.86(Google Chrome 73.0.3683.86)
    是因为被墙了才一直搜不到咩
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 73.0.3683.86(Google Chrome 73.0.3683.86)
      @STon3Dr3Am 机器人依赖的所有API都有没有被墙
      1. STon3Dr3Am  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 73.0.3683.86(Google Chrome 73.0.3683.86)
        @神代綺凜 Error: getaddrinfo ENOTFOUND 这种的
      2. STon3Dr3Am  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 73.0.3683.86(Google Chrome 73.0.3683.86)
        @神代綺凜 碰到楼下那个 [error] saucenao[0]的问题,小飞机挂全局还是会显示搜索失败服务器爆炸 ̄﹃ ̄
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 73.0.3683.86(Google Chrome 73.0.3683.86)
          @STon3Dr3Am 建议在国外机子上部署,因为国内网络不好
          并且只是单纯的使用小飞机的系统代理是没有用的,不会对nodejs网络请求生效,如果要挂建议直接SSTap
          1. STon3Dr3Am  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 73.0.3683.86(Google Chrome 73.0.3683.86)
            @神代綺凜 好的
  12. Paulzzh  GNU/Linux x64(GNU/Linux x64) / Google Chrome 73.0.3683.75(Google Chrome 73.0.3683.75)
    该评论仅登录用户及评论双方可见
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 73.0.3683.86(Google Chrome 73.0.3683.86)
      @Paulzzh
      该评论仅登录用户及评论双方可见
  13. 五彩斑斓  Android 9(Android 9) / Google Chrome 72.0.3626.121(Google Chrome 72.0.3626.121)
    该评论仅登录用户及评论双方可见
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 72.0.3626.121(Google Chrome 72.0.3626.121)
      @五彩斑斓
      该评论仅登录用户及评论双方可见
  14. 失足少女  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 68.0.3440.33(Google Chrome 68.0.3440.33)
    大大,竹竹最近是不是不能加群了,怎么拉不进群啊
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @失足少女 几百年前就不给加群了
  15. 画个圈跳出去  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 72.0.3626.119(Google Chrome 72.0.3626.119)
    我把你这个项目的部署过程录了个视频传到了b站,作者你应该不会有什么意见吧?如果不愿意我可以删除视频。OωO
    视频地址:https://www.bilibili.com/video/av45150196
    打不开就是还在审核。
    1. 牧濑红莉栖  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 87.0.4280.88(Google Chrome 87.0.4280.88)
      @画个圈跳出去 没看你的视频可惜了,硬是配了一天环境
    2. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @画个圈跳出去 (/ω\) 没意见
      1. 画个圈跳出去  Mac OS X(Mac OS X) / Mozilla Compatible(Mozilla Compatible)
        @神代綺凜
        该评论仅登录用户及评论双方可见
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
          @画个圈跳出去
          该评论仅登录用户及评论双方可见
          1. 画个圈跳出去  Mac OS X(Mac OS X) / Mozilla Compatible(Mozilla Compatible)
            @神代綺凜 好的,谢谢
  16. 闲云遮月  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
    不知道能不能整合这个网站https://ascii2d.net/,主要是可以搜推特的图,,毕竟有些画师只在推特上发图。。。或者其他能搜推特图的网站?
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @闲云遮月 其实很多推特图会有人传到danbooru上,搜图经常出的danbooru结果看左下角来源基本都是推特……
      有一个计划内的功能是得到danbooru结果的时候顺便直接把真图源链接作为搜索结果
      1. 闲云遮月  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
        @神代綺凜 主要是能搜到的结果和上面的网站差距有点大。。。saucenao的时效和精准度略有些过于差强人意 一个月前的推图都搜不到
        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 73.0.3683.103(Google Chrome 73.0.3683.103)
            @神代綺凜 在本地加个普通相似度对比如何?
            1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 73.0.3683.103(Google Chrome 73.0.3683.103)
              @画个圈跳出去 这个就过于麻烦了,即使有现成的包可以拿来用,时间开销也是个问题……
  17. 真叫人头大  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 49.0.2623.87(Google Chrome 49.0.2623.87)
    很神秘的一个问题,版本2.3.3,某些图片(绝大部分没有问题)自己部署的机器人搜不出正常结果,哪怕是指定了pixiv也不行,但是同一个图放竹竹里就能正常搜出P站链接∠( ᐛ 」∠)_请问这是个什么玄学问题
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @真叫人头大 这就不清楚了,有点头大
    2. 真叫人头大  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 49.0.2623.87(Google Chrome 49.0.2623.87)
      @真叫人头大 而且刚才测试了下,把竹竹给的链接带的缩略图丢进自己部署的机器人里,竟然搜出结果了,而高清原图还是不行(╯‵□′)╯︵┴─┴
  18. 露姆莉  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 72.0.3626.96(Google Chrome 72.0.3626.96)
    看看
  19. 莺在叫  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 72.0.3626.109(Google Chrome 72.0.3626.109)
    该评论仅登录用户及评论双方可见
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
      @莺在叫
      该评论仅登录用户及评论双方可见
  20. Chrle Leo  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 72.0.3626.109(Google Chrome 72.0.3626.109)
    "regs": {
    "searchModeOn": "小狐搜",
    "searchModeOff": "[谢謝]+小狐",
    搜图模式的配置是这个,不过为什么没有启动搜图模式
    1. Chrle Leo  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 72.0.3626.109(Google Chrome 72.0.3626.109)
      @Chrle Leo 是我阅读说明不够仔细了,(躺
      1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 71.0.3578.98(Google Chrome 71.0.3578.98)
        @Chrle Leo 我都还没看出来什么问题以为出bug了(
        1. Charle Leo  Mac OS X(Mac OS X) / Safari 12.0(Safari 12.0)
          @神代綺凜 不,并没有出问题,或者说只是我的用法出了问题,改了下通配符这下好了