Introduction:

QD, an automatic scheduled task execution framework, can help with auto check-in, auto commenting, auto lucky draw, and auto gift collection. If you can think of it, there's nothing it can't do (it can even bypass the CF five-second shield opened by websites through grabbing corresponding ip's ck and ua).

Environment Requirements:

The server IP has not been banned by the website where you want to deploy automated tasks.
Example: IPs of domestic VPS are basically banned by "Wu Ai Po Jie," so automatic check-in is not possible.

Deployment Method One: Install using Docker

Step One: Update Source

Ubuntu/Debian:

apt update -y && apt upgrade -y

Centos:

yum update -y && yum upgrade -y

Step Two: Install Docker

curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh

Step Three: Run QD Container

docker run -d --name qd -p 8923:80 -v $(pwd)/qd/config:/usr/src/app/config qdtoday/qd

If the container cannot communicate with the external network, try this command:

Use Host network mode to create a container, port number: 8923
docker run -d --name qd --env PORT=8923 --net=host -v $(pwd)/qd/config:/usr/src/app/config qdtoday/qd

Note: After creating the container with this command, please manually change the template's http://localhost/ style API requests to api:// or http://localhost:8923/ to properly complete the related API requests.

Step Four: Set Administrator

The first registered user is the default administrator; you must log out and then log back in to obtain full administrator privileges.
If you want to set more administrators, please follow the instructions below:

  1. Enter the Docker container:

    docker exec -it qd /bin/bash
  2. Set the administrator [change the email to the administrator's email]:

    python ./chrole.py your@email.address admin

    After deployment, you can access http://<your-ip>:8923 to visit the QD framework.

Deployment Method Two: Install from Source Code

Environment Requirement: Python Version >= 3.9

Step One: Update Source

Ubuntu/Debian:

apt update -y && apt upgrade -y

Centos:

yum update -y && yum upgrade -y

Step Two: Clone Repository

git clone https://github.com/qd-today/qd.git

Step Three: Install Dependencies

pip3 install -r requirements.txt

Step Four: Copy and Modify Configuration File

cp config.py local_config.py
vi local_config.py

Step Five: Start Program

python ./run.py

Note: Please manually change the template's http://localhost/ style API requests to api:// or http://localhost:8923/ to properly complete the related API requests.

The template needs to be published to appear in the "Public Templates." Admin permission is needed to approve it in "My Publication Requests."

Step Six: Set Administrator

The first registered user is the default administrator; you must log out and then log back in to obtain full administrator privileges.
If you want to set more administrators, please follow these instructions [change the email to the administrator's email]:

python ./chrole.py your@email.address admin

After deployment, you can access http://<your-ip>:8923 to visit the QD framework.

Configure Automatic Execution:

Step One: Add Public Template (Optional):

Public templates are ready-to-use templates configured by others. Very convenient, just fill in your own Cookie, account password, etc.
The official public templates provided in the file are:
https://github.com/qd-today/templates
You can also add public templates maintained by wjf0214:
https://github.com/wjf0214/qd-templates

Step Two: Obtain HAR by Packet Capture

  1. Press F12, Ctrl + Shift + I, or choose More Tools > Developer Tools from the Chrome menu.
  2. From the panel that opens at the bottom or right of the screen, select the Network tab.
  3. Ensure the Record button in the upper left of the Network tab is red.
  4. If it's gray, click once to start recording.
  5. Check Preserve Log.
  6. Click the Clear button to clear all existing logs in the Network tab.
  7. Try to reproduce the planned HTTP request.
  8. After reproducing the task, right-click anywhere on the network request grid.
  9. Choose Save as HAR with content.
  10. Save the file to your computer.

Step Three: Upload HAR File

  1. Click the + button on the right side of My Template.
  2. Upload the HAR file you just saved.

Step Four: Edit Template

  1. Replace parts like username, password, cookie, header, etc., that change according to the user with templates like {{ username }} (templates support jinja2 syntax).
  2. Use the test panel in request editing to test whether the template returns correctly, testing with correct and incorrect usernames.
  3. Fill in success/failure assertions, which helps detect if the template task has failed.
  4. When some data from the previous request is needed in the request, use variable extraction by regularizing data extraction, saving it in environment variables. Use a group selector ab(\w+)cd to select a part of it.
  5. Use __log__ to extract task logs.
  6. When all request editing is complete, use the Test button next to the download button to test the whole.
  7. The template being edited will automatically be saved in the browser cache, so no need to worry about losing it.
  8. Click the Save/Download button to save/download the template.

Step Five: Create Scheduled Task

  1. Click the + button on the right side of My Tasks.
  2. Select the template you just created.
  3. Fill in task variables, task interval, task group, and task execution time.
  4. Click the Test button to test the

task.

  1. Click the Save button to save the task.

Related Links:

Official Address: https://github.com/qd-today/qd
Default Public Template: https://github.com/qd-today/templates
wjf0214 Maintained Templates: https://github.com/wjf0214/qd-templates

Tag:Configure, QD, Automatic Scheduled Task Execution Framework, Auto Check-in

Original link:http://enblog.fuyiran.link/Technology/20.html

Copyright: All posts on this blog, unless otherwise stated, are published using theCC BY-NC-SA 4.0 license agreement. Please indicate the source for reprinting Fu Speaking (enblog.fuyiran.link)

Add a new comment.