dev test
- 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...
Github Actions Support (from https://github.com/ashawkey/autodxx)
-
Clone this repository.
-
Create github secrets (Settings --> Secrets --> New Repository secret):
- Original plan
- Use config.yaml (Beta)
- REMOTE_CONFIG: Create a config.yaml , upload to Gist to get raw's link (like https://gist.githubusercontent.com/ouyen/xxx/raw/xxx/config.yaml).
-
Edit
.github/workflow/main.yml
.- by default it runs at *08:00 *on every Tuesday, change
cron
if you want to run at a different time.
- by default it runs at *08:00 *on every Tuesday, change
-
Enable workflow for this repository in Actions.
Use requests to login.Add Multi-user supportAdd 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.