Caution
This extension is still under development. It may contain numerous bugs and has not been exhaustively tested.
This Google Chrome extension allows you to download lecture recordings from McGill's myCourses platform. Follow the instructions below to ensure you have all the required data to use this extension effectively.
- Clone or download this repository.
- To clone the repository, use
git clone https://github.com/EnYiHou/mcgill-lecture-downloader.git
. - Alternatively, you can download the
crx
file from the releases section.
- To clone the repository, use
- Open Chrome and go to
chrome://extensions/
. - Enable "Developer mode" in the top right corner.
- Load the downloaded extension to Google Chrome.
- If you cloned the repository, click on "Load unpacked" and select the directory where you downloaded/cloned this repository.
- If you downloaded the
crx
file, drag and drop it into the Chrome extensions page.
- Go to myCourses and log in.
- Navigate to the course you want to download lecture recordings from.
- Watch a lecture video of the course.
- Click on the extension icon in the Chrome toolbar to verify that everything works.
- If the extension does not work, please open an issue for assistance.
This extension was developed by analyzing the McGill lecture recording system and identifying the necessary data required to download lectures. Key variables used in the code include:
cookie
: The cookie value used for authentication and session management.bearer
: Authorization tokenstoken
: Session tokenetime
: Expiration time
- getPayLoad: Fetches the payload required for authentication and extracts necessary input fields from the HTML response.
- getHFCourseIDHTML: Uses the payload to make a POST request and retrieve the course ID.
To ensure the Chrome extension does not create a standard popup that disappears when the cursor loses focus, we created a custom popup using JavaScript:
-
createPopup: Creates a custom popup element with an embedded iframe.
-
makeDraggable: Makes the popup draggable by attaching mouse event listeners.
-
attach and detach: Attaches and removes the custom popup to the DOM, respectively.
The background script is essential for capturing the required data, such as authorization tokens, course lists, and cookies:
- chrome.webRequest.onBeforeSendHeaders.addListener: Intercepts HTTP requests to capture necessary data and store it in Chrome's local storage.
If you would like to contribute to this project, please fork the repository and submit a pull request.