A quick guide to downloading course materials using the Python dl_coursera tool. Note: Only download courses you are enrolled in. Cookies expire every 2 weeks – export new ones if downloads stop working. What You Need:
- Python installed
- A Coursera account
- Browser with cookie exporter extension
Step 1: Install Python
Download and install Python from python.org (version 3.7 or higher). During installation on Windows, check “Add Python to PATH” and verify installation:
python --version
Step 2: Install dl_coursera
Open Terminal (Mac/Linux) or Command Prompt/PowerShell (Windows) and run:
pip install -U dl_coursera
Step 3: Get Your Cookies
Install a cookie exporter extension for your browser:
- Chrome/Edge/Brave: “Get cookies.txt” from Chrome Web Store
- Firefox: “Export Cookies” from Firefox Add-ons
- Log into your Coursera account. Click the extension icon and export cookies
- Save the file as cookies.txt
Remember where you saved it (Downloads folder is fine)
Step 4: Find Your Course Slug
The slug is the course identifier in the URL.
Examples:
https://www.coursera.org/learn/social-psychology → slug: social-psychology
https://www.coursera.org/learn/machine-learning → slug: machine-learning
Step 5: Download the Course
If cookies.txt is in your current directory:
dl_coursera --cookies cookies.txt social-psychology
If cookies.txt is elsewhere:
dl_coursera --cookies /path/to/cookies.txt social-psychology
Specify output directory:
dl_coursera --cookies cookies.txt --outdir ./downloads social-psychology
For paths with spaces (Windows):
dl_coursera --cookies "C:\Users\Name\My Drive\cookies.txt" social-psychology
Common Issues
| Problem | Solution |
|---|---|
| “No such file or directory: ‘cookies.txt'” | Use full path or navigate to the correct folder |
| “unrecognized arguments” | Put paths with spaces in quotes |
| Authentication failed | Cookies expired – export fresh ones |
| Download stalls | Delete the .cache folder and retry |
Files Downloaded
The tool creates a folder with the course slug containing:
- Video lectures (MP4)
- Subtitles
- Readings (PDF)
- Jupyter notebooks
- Quiz questions
Update the Tool
pip install -U dl_coursera