QD ~ An Automatic Scheduled Task Execution Framework Not Limited to Auto Check-in
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:
Enter the Docker container:
docker exec -it qd /bin/bash
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
- Press F12, Ctrl + Shift + I, or choose More Tools > Developer Tools from the Chrome menu.
- From the panel that opens at the bottom or right of the screen, select the Network tab.
- Ensure the Record button in the upper left of the Network tab is red.
- If it's gray, click once to start recording.
- Check Preserve Log.
- Click the Clear button to clear all existing logs in the Network tab.
- Try to reproduce the planned HTTP request.
- After reproducing the task, right-click anywhere on the network request grid.
- Choose Save as HAR with content.
- Save the file to your computer.
Step Three: Upload HAR File
- Click the + button on the right side of My Template.
- Upload the HAR file you just saved.
Step Four: Edit Template
- Replace parts like username, password, cookie, header, etc., that change according to the user with templates like {{ username }} (templates support jinja2 syntax).
- Use the test panel in request editing to test whether the template returns correctly, testing with correct and incorrect usernames.
- Fill in success/failure assertions, which helps detect if the template task has failed.
- 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. - Use
__log__
to extract task logs. - When all request editing is complete, use the Test button next to the download button to test the whole.
- The template being edited will automatically be saved in the browser cache, so no need to worry about losing it.
- Click the Save/Download button to save/download the template.
Step Five: Create Scheduled Task
- Click the + button on the right side of My Tasks.
- Select the template you just created.
- Fill in task variables, task interval, task group, and task execution time.
- Click the Test button to test the
task.
- 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
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)