Rat's

A quadratic image search, fan search, book search sub QQ robot, supporting websites such as SauceNAO, WhatAnime, Ascii2d, etc
Description: CQ picfinder robot is a cool Q robot plug-in written by Qilin blogger using Nodejs, integrating multiple excellent projects
Scan the QR code on the right to read the full text
eleven
2019/06

A quadratic image search, fan search, book search sub QQ robot, supporting websites such as SauceNAO, WhatAnime, Ascii2d, etc

explain: CQ-picfinder-robot Is a Qilin Blogger use Nodejs Prepared Cool Q The robot plug-in integrates several excellent projects, which are used to search for pictures, fans and books, and contains many entertainment oriented functions; The principle is to use SauceNAO WhatAnime Ascii2d Search from Pixiv Twitter Danbooru etc. twenty Illustrations, books and animations of multiple sites. You only need one picture to accurately locate the origin of its pictures, notebooks, and animations. The method of use is also very simple, but it seems that they are all in the Windows After all, it's very convenient to use it on the Linux VPS Method of use in.

screenshot

 Please enter a picture description

install

Github address: https://github.com/Tsuk1ko/CQ-picfinder-robot

explain: The plug-in must cooperate Cool Q Used together and needs to be started CoolQ HTTP API Plug in, and set the configuration file use_ws Set to true , refer to: Plug in Usage Document

Tips: If your VPS Memory is too small, including 512M Memory. It is recommended to add some virtual memory, Swap One click script → Portal

1. Install CoolQ robot

 Prompt: Pro is recommended if you want complete functions; However, Pro is not necessary, Air can also, but Air cannot send pictures, and some functions will be limited, but it can meet the basic use.

If you use Windows The system is installed by itself; Linux System, use Docker For installation, the tape is used here CoolQ HTTP API Plug-in CoolQ Docker The specific steps are as follows.

install Docker

 #CentOS 6 rpm -iUvh  http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum update -y yum -y install docker-io service docker start chkconfig docker on #CentOS 7、Debian、Ubuntu curl -sSL  https://get.docker.com/  | sh systemctl start docker systemctl enable docker

install CoolQ

 #Install Cool Q Air Turing docker run --name wine-coolq -d \ -v /coolq:/home/user/coolq \ -p 9000:9000 \ -p 6700:6700 \ -e VNC_PASSWD=moerats \ richardchien/cqhttp #Install Cool Q Pro Turing docker run --name wine-coolq -d \ -v /coolq:/home/user/coolq \ -p 9000:9000 \ -p 6700:6700 \ -e VNC_PASSWD=moerats \ -e COOLQ_URL= https://dlsec.cqp.me/cqp-tuling  \ richardchien/cqhttp

Parameter description:

 -PMap the internal Web running port 9000 to the external 9000, and you can modify the port yourself. -V maps the internal cool Q and its data folder/home/user/coolq to the external/coolq folder, and you can modify the path yourself. -E VNC_PASSWD is the VNC password. Note that the password cannot exceed 8 characters. The default is MAX8char.

Then delete the default configuration file, otherwise specific QQ Configuration file, use the command:

 rm -rf /coolq/app/io.github.richardchien.coolqhttpapi/config/general.ini

Then you can access http://ip:9000 , Enter VNC Page password, default in the text moerats , you can see a Cool Q Started, if it is Pro If so, you will be asked to enter the authorization code first.

If the interface cannot be opened, it needs to be opened nine thousand Port, which generally appears in CentOS The system is opened as follows:

 #CentOS 6 iptables -I INPUT -p tcp --dport 9000 -j ACCEPT service iptables save service iptables restart #CentOS 7 firewall-cmd --zone=public --add-port=9000/tcp --permanent firewall-cmd --reload

Some servers, such as Alibaba Cloud and Google Cloud, also need to open this port in the panel security group.

First login QQ The account will generate specific CoolQ HTTP API Configuration file, path is app/io.github.richardchien.coolqhttpapi/config , and then make the following modifications:

 #Pay attention to this operation every time a new QQ number login robot is replaced 1. Find the configuration file according to the path in the format of QQ No. json 2. Edit the configuration file and change false after use_ws to true #If you don't want to bother, you can use the command to modify it directly on the ssh client. The command is as follows: sed -i 's#"use_ws": false#"use_ws": true#g' /coolq/app/io.github.richardchien.coolqhttpapi/config/*.json

Next on VNC Right click the levitation ball in the lower right corner of the page to quickly restart the robot.

2. Install Nodejs

 #Debian/Ubuntu system curl -sL  https://deb.nodesource.com/setup_10.x  | bash - apt install -y git nodejs  #CentOS system curl -sL  https://rpm.nodesource.com/setup_10.x  | bash - yum install nodejs git -y

3. Install CQ picfinder robot

 #Pull Item git clone  https://github.com/Tsuk1ko/CQ-picfinder-robot.git cd CQ-picfinder-robot #Copy Profile cp config.default.json config.json #Installation dependency npm i #Install pm2 npm install -g pm2

config.json The configuration file reference is as follows:

 #Do not copy the following configuration file directly. JSON does not allow comments, but only for reference { //Please refer to https://github.com/momocow/node-cq-websocket/blob/master/docs/api/CQWebSocket.md#cqwebsocketoption "host": "127.0.0.1", "port": 6700, "enableAPI": true, "enableEvent": true, "access_token": "", "reconnection": true, "reconnectionAttempts": 10, "reconnectionDelay": 5000, //The following starts with the configuration of the image search robot "picfinder": { "Debug": false,//Debug mode. When enabled, the returned text of each query will be output on the console "Admin": - 1,//Specify the manager QQ, please be sure to set "AutoAddFriend": false,//Automatically agree to the friend application (if false, it will be ignored, but will not be rejected) "AddFriendAnswers": [],//Answer the question and agree to the friend application (detailed explanation later "AutoAddGroup": false,//Automatically agree to the group membership application (false is the same as above, but you can use the command to manually allow it, which will be explained later) "SearchLimit": 30,//Limit the number of searches per user per day //Repeater "repeat": { "Enable": true,//switch "Times": 3,//When it is detected that a group has made the same speech for so many times, it will be likely to participate in the re reading "Probability": 40,//repetition probability (percentage) "CommonProb": 0.1//Daily repetition probability (percentage) }, //Setu function "setu": { "Enable": false,//Whether to enable "AllowPM": true,//Allow private chat "PximgProxy": "",//Set the reverse proxy used when sending the setu. Details will follow "DeleteTime": 30,//It is automatically recalled so many seconds after sending (0 means no recall, the same below) "Cd": 600,//Use the cooling time (seconds). Each user is independent, and 0 means no cooling "Limit": 30,//Limit the number of times per user per day "WhiteGroup": [],//group whitelist (please fill in according to the json array format) "WhiteOnly": false,//only allowed for whitelist groups (independent of the above private chat use) "WhiteCd": 0,//The usage cooling time of whitelist groups "WhiteDeleteTime": 0//The recall time of the whitelist group }, //Instruction Regular Expression "regs": { //Enable image search mode "SearchModeOn": "Bamboo Search [Picture]", //Turn off image search mode "SearchModeOff": "[Thank you]+Bamboo", //Sign in "Sign": "I (. *) sign in", //setu "Setu": "(Bamboo. * [Send to]. * [Sese] [Picture]) | (-- setu)" }, //Reply "replys": { //Default Reply "Default": "I need to send pictures to help you find" _ (: 3 ""  n Batch is supported! ", //In debug mode "Debug": "The maintenance upgrade is in progress and cannot be used temporarily. Sorry~", //When the number of personal searches reaches the maximum "PersonLimit": "The pictures you searched today are too hot! Take a break and search again tomorrow~", //When the search fails "Failed": "Search failure caused QAQ  n It may be the server network explosion, please try again", //Sign in related "Sign": "Sign in successfully and give you 10 likes!", "Signed": "You have signed in today _ (: 3" ∠) _ ", //Enable image search mode "SearchModeOn": "Understand~Please send pictures! Batch is supported!  N If you want to exit the search mode, please send" Thank you Bamboo ", //Image search mode has been enabled "SearchModeAlreadyOn": "You are already in the image search mode!  NIf you want to exit the search mode, please send" Thank you Bamboo ", //Turn off image search mode "SearchModeOff": "You're welcome~", //Image search mode has been turned off "searchModeAlreadyOff": "にゃ~", //Setu cooling "SetuLimit": "Good, you should know how to control → _ →", //Setu request error "SetuError": "Thurto server explosion _ (: 3" ∠) _ ", //Other conditions for sending setu are not met "SetuReject": "Sorry, this function is temporarily closed _ (: 3" " }, //OCR (see "Additional Functions" for details) "ocr": { "Use": "ocr. space",//Select the OCR service to use "ocr.space": { "defaultLANG": "eng", "apikey": "" }, "baidubce": { "useApi": "accurate_basic", "apiKey": "", "secretKey": "" } }, //Tomorrow's Ark Public Recruitment Calculator (see "Additional Functions" for details) "akhr": { "Enable": false,//true "Ocr": "ocr. space"//Select the OCR service to use } }, //Database configuration (used to cache image search results) "mysql": { "Enable": false,//Whether to enable the cache function "Expire": 172800,//Cache time (seconds), default is two days (172800 seconds) "Host": "127.0.0.1",//Database address "Port": 3306,//port "Db": "",//Database name "User": "",//User name "Password": "",//Password "Expire": 172800//Cache time }, //Please do not move the Saucenao address unless you have guessed the meaning of this setting( "saucenaoHost": [ "saucenao.com" ], //The domain name of WhatAnime is the same as above "whatanimeHost": [ "trace.moe" ] }

Start and other operation commands:

 #Run npm run pm2start #Stop npm run pm2stop #Restart npm run pm2restart #View Log npm run pm2log

It is recommended to view the log after the startup is successful. If the connection is successful, the installation is successful.

use

1. Daily use

 #Private chat 1. Send pictures directly 2. See the description of image search mode below #Groups&Discussion Groups 1. @ Robot and send pictures 2. See the description of image search mode below (group limitation) 3. In particular, in the group, you can send statements that conform to the regular expression in the configuration to enter the image search mode. In the image search mode, all pictures sent will be searched even if they are not @. This function is usually used when the mobile phone cannot forward pictures @; In addition, please remember to exit the image search mode after entering the image search mode! #Multiple pictures can be included in the same message (for PC), and will be automatically searched in batches #When searching for pictures, you can include the following parameters in the message to specify the search scope or use a function. The parameters are mutually exclusive and the priority is from top to bottom 1. -- get url: Get the online link of the image (no image search) 2. -- a2d: use ascii2d to search (the advantage is that local graphs can be searched) 3. -- pixiv: Search from P station 4. -- danbooru: search from Danbooru 5. -- book: Search book 6. -- anime: search for dramas #If the similarity of the results obtained by saucenao is less than 60%, ascii2d will be automatically used for searching #If you find the book, it will automatically search in the nhentai and return the link (if there is a Chinese version, it will give priority to return the Chinese version link) #If you find drama, WhatAnime will be automatically used to search drama details 1. It is normal that the results of AnimeDB and WhatAnime may be inconsistent. After all, these are two different search engines 2. The purpose of both searches is to try to get the recognition results you may want

2. Image search mode

 #The meaning of the image search mode is to facilitate mobile phone users to specify the search database when forwarding pictures or other inconvenient messages with @ or image search parameters #Send gallery keywords directly during private chat At this time, the next picture you send (only the next one, that is, one-time) will use the specified search base #Send a speech conforming to the configured regular expression in the group to enter the image search mode 1. At this time, all the pictures you send will be searched (full range search is used by default) 2. After sending the keywords of the gallery, all the pictures you send later will use the search gallery you specified 3. Please remember to exit the image search mode after each use. In the same way, it is also to send a speech that conforms to the regular expression in the configuration #Library keywords: 1. All: default full scope search mode 2. The following functions are the same as the search parameters described in "Daily Use" above pixiv danbooru book anime

3. Process friend application

 #If "Allow anyone" is set in QQ, it will pass directly and KuQ cannot intervene #If "verification information is required" is selected, it is determined by the autoAddFriend setting item #If "need to answer the question correctly" is selected, whether it is decided by the other party's answer, KuQ cannot intervene #If "I need to answer the question and let me confirm" is selected, the judgment will be made when autoAddFriend is true and the addFriendAnswers array is not empty. Only when the answer of the other party is completely consistent with the setting of addFriendAnswers can we agree

autoAddFriend by false Will not actively reject the application, but just ignore the application, autoAddGroup The same is true.

addFriendAnswers Configuration rules:

 #Please write the answers to the questions in order as the elements of the addFriendAnswers array, for example: "addFriendAnswers": [ "The answer to question one", "The answer to question two" ]

At present, it seems that you can only set two questions at most. Please be sure to write a number of elements equal to the number of questions. If you write more, it will explode.

If you set two questions, but only in addFriendAnswers If an element is written in the array, only the first question will be verified.

4. Manually agree to join the group application
When you set picfinder.admin For your own QQ After, if one hundred and twenty-three million four hundred and fifty-six thousand seven hundred and eighty-nine It is the group that you need to let the robot add and send it to the robot private chat --add-group=123456789 , at this time:

 #If the group has invited robots before when the robots are running, the invitation will be directly agreed #If you have not invited before, the next invitation will be accepted #The above two operations are one-time

5. Block users/groups
send out --ban-u=Q No. or --ban-g= Group ID, this blocking function is not really pulled into the blacklist, but simply ignores the user/group's speech. If you want to unblock, please edit it yourself data/ban.json Delete Corresponding Q No./Group No.

More configuration and use instructions can be seen directly Github Description → Portal

explain

 #Why do you sometimes search for unwanted results? It should be noted that it takes time for the image search engine to find new images and collect them, so paintings just uploaded by painters are generally not available In addition, the pictures sent during image search must be exactly complete. Using the pictures in the following cases will result in no search results: 1. The partial image of the original image is used, that is, it is incomplete due to clipping. At this time, you can try to use the feature search function of ascii2d 2. The part of the picture covered by mosaic/picture mosaic is too large 3. The screenshot is not well cut, leaving a black edge. For example, in order to save trouble, you can directly use your mobile phone to take screenshots or manually frame and select screenshots on the computer. In this case, please edit and cut off the parts irrelevant to the picture 4 before searching 4. Picture with low definition

Finally, let's talk about the restart operation. The image will be generated every time you restart it general.ini File, which seems to cause certain QQ The configuration does not take effect. This can be done after installing Docker Add variables when mirroring -e COOLQ_ACCOUNT=123456 To solve this problem, you can also delete the file when restarting, and then log in VNC OK.

 docker restart wine-coolq rm -rf /coolq/app/io.github.richardchien.coolqhttpapi/config/general.ini

For the use of this robot, the blogger only has a general understanding of it, and may not notice it. If there are other problems, he can study them by himself.

Vultr New user registration send one hundred USD/ sixteen Each computer room is charged by hour, and Alipay is supported【 Click to view 】。
Last modification: January 22, 2020 02:58 PM

Comment

97 comments

  1. Jiuling Network

    Can only search the content in the corresponding site? Is there any charge for the later period?

  2. shiika

    Now Cool Q doesn't work. Tsuk1ko's CQ picfinder robot is also adapted to go cqhttp. Hey, can vps be used with it?

    1. Rat's
      @shiika

      Sometimes I look at this

      1. shiika
        @Rat's

        Thanks~It seems that it can run directly in Linux after a rough test according to the deployment process of Tsuk1ko. However, if you open go cqhttp, you cannot run the plug-in. Running go cqhttp in the background with the nohup command seems to fail. It's up to you

        1. hbksinukse
          @shiika

          I want to ask you how to run go cqhttp on Linux

          1. shiika
            @hbksinukse

            My robot is ready. After decompression, enter "./go - cqhttp - d" in the current directory of the file to generate some files, and then configure your own qq account password in config.json. Then use the command "nohup./go cqhttp&" to hang up in the background. Then the usage of cq picsearcher bot is similar to that before.

            1. hbksinukse
              @shiika

              Thank you. I'm building a platform to learn more

          2. shiika
            @hbksinukse

            After decompression, enter it in the current directory of the file/ go-cqhttp -d

  3. shiika

    Now all robots are closed... Tsuk1ko's CQ picfinder robot is also adapted to go cqhttp. Hey, can vps be used with it? I don't know if this can help you. Personally, I don't understand... https://github.com/SJTU-Plus/ManageBotDocker/pull/1/files

    1. shiika
      @shiika

      https://github.com/Mrs4s/go-cqhttp/commit/5d2e202b0c5a2b187545ae92d6fa3fef94da5c2b

  4. Kiriko

    Why can't group chat or search pictures after installation

  5. ray
    This comment is only visible to login users and both parties
    1. Rat's
      @ray

      You can use traffic analysis software, such as iftop, and Baidu

  6. bearcloney

    After reboot, the docker start wine coolq is entered
    The VNC can be connected, but the robot still doesn't respond. How to solve it

    1. Rat's
      @bearcloney

      No error message after entering?

  7. Village rain

    Does this plug-in support packaging into a cpk?

  8. Goleya

    Today, I encountered a very subtle situation when deploying this product in Alibaba Cloud. The http api provided by yobot (PCR battle robot) is not applicable to this robot. Need to go to the original project to get another original. Otherwise, strange errors such as the failure to initialize the API interface will occur during deployment.
    If a friend searches here, you can refer to it
    TL; DR: Please strictly follow the instructions when deploying (doge face)

    1. Ah, see
      @Goleya

      The same pcr robot was successfully connected, but the private robot did not reply, so I don't know what the problem is

  9. LonginusL33T

    NoVNC encountered an error:

    Uncaught TypeError: Cannot read property 'addEventListener' of null
    http://cen-sz-011.xn--pbtp9x388a0kf.com:20009/app/ui.js:315:13
    TypeError: Cannot read property 'addEventListener' of null

    at Object.addConnectionControlHandlers ( http://cen-sz-011.xn--pbtp9x388a0kf.com:20009/app/ui.js:315:13 ) at Module.start ( http://cen-sz-011.xn--pbtp9x388a0kf.com:20009/app/ui.js:89:12 ) at Module.initSettings ( http://cen-sz-011.xn--pbtp9x388a0kf.com:20009/app/webutil.js:131:22 ) at Object.load ( http://cen-sz-011.xn--pbtp9x388a0kf.com:20009/app/ui.js:55:17 ) at Object.prime ( http://cen-sz-011.xn--pbtp9x388a0kf.com:20009/app/ui.js:46:16 ) at http://cen-sz-011.xn--pbtp9x388a0kf.com:20009/app/ui.js:1655:12 at XMLHttpRequest.req.onload ( http://cen-sz-011.xn--pbtp9x388a0kf.com:20009/app/webutil.js:235:13 )

    It suddenly didn't work a few days ago. Then I will reinstall it anyway. This error will appear on the page after installing coolQ and accessing 9000. I reinstalled the VPS system, and CQHTTP is also the latest.

    1. Rat's
      @LonginusL33T

      It should be a noVNC jump. See if there is not enough memory or hard disk

      1. LonginusL33T
        @Rat's

        I changed the VPS installation, and the memory and hard disk are absolutely enough, but I don't know why the coolahttpapi folder does not exist under the app file when I first log in to the QQ number and modify the API configuration file. When the service is started after installation, the pm2 log always reports a connection error Failed to establish the websocket connection. However, the 9000 port can be accessed, and the original function of coolq can also be used in QQ. Very strange.

  10. Shangguan

    "Setu":$
    This command