Autoscript for sustech course on tencent MOOC platform
- Download this repo and install requests library in your python environment: pip install requests
- Login to lexiangla.com and use chrome extension https://cookie-editor.com/ to dump the cookies of your session into a json, paste its contents to a new text file cookies.json in this directory.
- Launch script.py
- Enjoy
This work is based on basic reverse engineering of the protocol used by the server to track its users, which works as follows:
- The client obtains an additional token on login which is used to post data to a tracking endpoint.
- Javascipt from the client's browser posts a 1 at the begining of each course to the course's endpoint and then posts a 2 every about 30 seconds, the server sets up a timer that begins on the on and is kept alive by the 2.
- When the timer hits the duration of the course, the couse is marked as completed on the server.
Therefore, this code simulates this hearbeat protocol to achieve what it does.