-
Clone this repository.
-
Create github secrets (Settings --> Secrets --> New Repository secret):
-
Edit
.github/workflow/main.yml
.- by default it runs at 16:50 UTC+8 on every Friday, change
cron
if you want to run at a different time.
- by default it runs at 16:50 UTC+8 on every Friday, change
-
Enable workflow for this repository in Actions.
- Install python ,
GeckoDriver,runpip3 install -r requirements.txt
to install requirements. - Copy config.example.yaml to config.yaml. Edit config.yaml. (Enter this website to retrieve the account and password. Get your organization id here)
- run
python3 main.py
to learn QNDXX
-
Use selenium to log in to Beijing Communist Youth League's Website to get cookies.(use dddocr to recognize the captcha)Get cookies with requests.
-
Use cookies to get the newest course id. (from https://m.bjyouth.net/dxx/index)
-
Send a request to https://m.bjyouth.net/dxx/check?id=50&org_id=172442 to finish learning.(you can visit org list to get org_id)
Your config.yaml
should be like this:
youth:
- username: ''
password: ''
org_id: '172442'
message_url: ''
send_message_org_id: '172442'
# user2
- username: ''
password: ''
org_id: '172442'
message_url: ''
send_message_org_id: '172442'
# user3...
Use requests to login.Add Multi-user support- Add mail support.
In general, it is always possible to go through the normal process in selenium headless mode, but the current method is feasible, so I will not continue to develop it now.