Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

coursera-dl

> 开发工具
Open source

Script for downloading Coursera.org videos and naming them.

9.6K stars0 likes3 views
WebsiteGitHub

About

Script for downloading Coursera.org videos and naming them.

Coursera Downloader

  • Coursera Downloader
  • Introduction
  • Features
  • Disclaimer
  • Installation instructions
    • Recommended installation method for all Operating Systems
    • Alternative ways of installing missing dependencies
      • Alternative installation method for Unix systems
      • ArchLinux
      • Installing dependencies on your own
    • Docker
    • Windows
    • Create an account with Coursera
  • Running the script
    • Resuming downloads
  • Troubleshooting
    • China issues
    • Found 0 sections and 0 lectures on this page
    • Download timeouts
    • Windows: proxy support
    • Windows: Failed to create process
    • SSLError: [Errno 1] _ssl.c:504: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
    • Alternative CDN for MathJax.js
  • Reporting issues
  • Filing an issue/Reporting a bug
  • Feedback
  • Contact

Introduction

[Coursera][1] is arguably the leader in massive open online courses (MOOC) with a selection of more than 300 classes from 62 different institutions [as of February 2013][13]. Generous contributions by educators and institutions are making excellent education available to many who could not afford it otherwise. There are even non-profits with "feet on the ground" in remote areas of the world who are helping spread the wealth (see the feedback below from [Tunapanda][14]).

This script makes it easier to batch download lecture resources (e.g., videos, ppt, etc) for Coursera classes. Given one or more class names and account credentials, it obtains week and class names from the lectures page, and then downloads the related materials into appropriately named files and directories.

Why is this helpful? A utility like [wget][2] can work, but has the following limitations:

  1. Video names have numbers in them, but this does not correspond to the actual order. Manually renaming them is a pain that is best left for computers.
  2. Using names from the syllabus page provides more informative names.
  3. Using wget in a for loop picks up extra videos which are not posted/linked, and these are sometimes duplicates.

Browser extensions like DownloadThemAll is another possibility, but coursera-dl provides more features such as appropriately named files.

This work was originally inspired in part by [youtube-dl][3] by which I've downloaded many other good videos such as those from Khan Academy.

Features

  • Support for all kinds of courses (i.e., "Old Platform"/time-based as well as "New Platform"/on-demand courses).
  • Intentionally detailed names, so that it will display and sort properly on most interfaces (e.g., [VLC][4] or MX Video on Android devices).
  • Regex-based section (week) and lecture name filters to download only certain resources.
  • File format extension filter to grab resource types you want.
  • Login credentials accepted on command-line or from .netrc file.
  • Default arguments loaded from coursera-dl.conf file.
  • Core functionality tested on Linux, Mac and Windows.

Disclaimer

coursera-dl is meant to be used only for your material that Coursera gives you access to download.

We do not encourage any use that violates their [Terms Of Use][20]. A relevant excerpt:

"[...] Coursera grants you a personal, non-exclusive, non-transferable license to access and use the Sites. You may download material from the Sites only for your own personal, non-commercial use. You may not otherwise copy, reproduce, retransmit, distribute, publish, commercially exploit or otherwise transfer any material, nor may you modify or create derivatives works of the material."

Installation instructions

coursera-dl requires Python 2 or Python 3 and a free Coursera account enrolled in the class of interest. (As of February of 2020, we test automatically the execution of the program with Python versions 2.7, Pypy, 3.6, 3.7, 3.8, and 3.9).

Note: We strongly recommend that you use a Python 3 interpreter (3.9 or later).

On any operating system, ensure that the Python executable location is added to your PATH environment variable and, once you have the dependencies installed (see next section), for a basic usage, you will need to invoke the script from the main directory of the project and prepend it with the word python. You can also use more advanced features of the program by looking at the "Running the script" section of this document.

Note: You must already have (manually) agreed to the Honor of Code of the particular courses that you want to use with coursera-dl.

Recommended installation method for all Operating Systems

From a command line (preferably, from a virtual environment), simply issue the command:

bash
pip install coursera-dl

This will download [the latest released version][23] of the program from the [Python Package Index (PyPI)][22] along with all the necessary dependencies. At this point, you should be ready to start using it.

If this does not work, because your Python 2 version is too old (e.g. 2.7.5 on Ubuntu 14.4), try:

apt-get install python3 python3-pip
pip3 install coursera-dl

instead.

Note 1: We strongly recommend that you don't install the package globally on your machine (i.e., with root/administrator privileges), as the installed modules may conflict with other Python applications that you have installed in your system (or they can interfere with coursera-dl). Prefer to use the option --user to pip install, if you need can.

Note 2: As already mentioned, we strongly recommend that you use a new Python 3 interpreter (e.g., 3.9 or later), since Python 3 has better support for SSL/TLS (for secure connections) than earlier versions.
If you must use Python 2, be sure that you have at least Python 2.7.9 (later versions are OK).
Otherwise, you can still use coursera-dl, but you will have to install the extra package ndg-httpsclient, which may involve compilation (at least on Linux systems).

Alternative ways of installing missing dependencies

We strongly recommend that you consider installing Python packages with [pip][17], as in it is the current [preferred method][18], unless directed otherwise by one of the project members (for instance, when testing or debugging a new feature or using the source code directly from our git repository). If you are using pip, you can directly install all the dependencies from the requirements file using pip install -r requirements.txt.

Alternative installation method for Unix systems

We strongly recommend that you install coursera-dl and all its dependencies in a way that does not interfere with the rest of your Python installation. This is accomplished by the creation of a virtual environment, or "virtualenv".

For the initial setup, in a Unix-like operating system, please use the following steps (create/adapt first the directory /directory/where/I/want/my/courses):

bash
cd /directory/where/I/want/my/courses
virtualenv my-coursera
cd my-coursera
source bin/activate
git clone https://github.com/coursera-dl/coursera-dl
cd coursera-dl
pip install -r requirements.txt
./coursera-dl ...

To further download new videos from your classes, simply perform:

bash
cd /directory/where/I/want/my/courses/my-coursera
source bin/activate
cd coursera-dl
./coursera-dl ...

We are working on streamlining this whole process so that it is as simple as possible, but to support older versions of Python and to cope with Coursera disabling SSLv3, we have to take a few extra steps. In any case, it is highly recommended that you always install the latest version of the Python interpreter that you can.

ArchLinux

AUR package: coursera-dl

Installing dependencies on your own

Warning: This method is not recommended unless you have experience working with multiple Python environments.

You can use the pip program to install the dependencies on your own. They are all listed in the requirements.txt file (and the extra dependencies needed for development are listed in the requirements-dev.txt file).

To use this method, you would proceed as:

bash
pip install -r requirements.txt
pip install -r requirements-dev.txt

The second line above should only be needed if you intend to help with development (and help is always welcome) or if a maintainer of the project asks you to install extra packages for debugging purposes.

Once again, before filing bug reports, if you installed the dependencies on your own, please check that the versions of your modules are at least those listed in the requirements.txt file (and, requirements-dev.txt file, if applicable).

Docker

If you prefer you can run this software inside Docker:

bash
docker run --rm -it -v \
    "$(pwd):/courses" \
    courseradl/courseradl -u <USER> -p <PASSWORD>

Or using netrc file:

bash
docker run --rm -it \
    -v "$(pwd):/courses" -v "$HOME/.netrc:/netrc" \
    courseradl/courseradl -n /netrc

The actual working dir for coursera-dl is /courses, all courses will be downloaded there if you don't specify otherwise.

Windows

python -m pip install coursera-dl

Be sure that the Python install path is added to the PATH system environment variables. This can be found in Control Panel > System > Advanced System Settings > Environment Variables.

Example:
C:\Python39\Scripts\;C:\Python39\;

Or if you have restricted installation permissions and you've installed Python under AppData, add this to your PATH.

Example:
C:\Users\<user>\AppData\Local\Programs\Python\Python39-32\Scripts;C:\Users\<user>\AppData\Local\Programs\Python\Python39-32;

Coursera-dl can now be run from commandline or powershell.

Create an account with Coursera

If you don't already have one, create a [Coursera][1] account and enroll in a class. See https://www.coursera.org/courses for the list of classes.

Running the script

Refer to coursera-dl --help for a complete, up-to-date reference on the runtime options supported by this utility.

Run the script to download the materials by providing your Coursera account credentials (e.g. email address and password or a ~/.netrc file), the class names, as well as any additional parameters:

    General:                     coursera-dl -u <user> -p <pass> modelthinking-004

    With CAUTH parameter:	 coursera-dl -ca 'some-ca-value-from-browser' modelthinking-004

If you don't want to type your password in command line as plain text, you can use the script without -p option. In this case you will be prompted for password once the script is run.

Here are some examples of how to invoke coursera-dl from the command line:

…

Note: If your ls command is aliased to display a colorized output, you may experience problems. Be sure to escape the ls command (use \ls) to assure that no special characters get sent to the script.

Note that we do support the New Platform ("on-demand") courses.

By default, videos are downloaded at 540p resolution. For on-demand courses, the --video-resolution flag accept

Issues· 218 open

View all issuesOpen on GitHub
  • #880

    Not able to authenticate and login

    Updated Apr 11, 2026
  • #878

    JSON ERROR

    Updated Apr 4, 2026
  • #850

    Coursera - API Route Does Not Exist They have upgraded to V3

    Updated Feb 7, 2026
  • #867

    Seems Like Coursera API or Authentication problem

    Updated Jan 18, 2026
  • #784

    ModuleNotFoundError: No module named 'multiprocessing'

    Updated Dec 29, 2025
  • #877

    Json Decoder Error

    Updated Nov 15, 2025
  • #744

    403 client error, Forbidden for URL

    Updated Sep 2, 2025
  • #872

    Can't download Professional Certificate course

    Updated Apr 15, 2025
  • #870

    Error logging in?

    Updated Apr 13, 2025
  • #874

    How to download these PPT from this link "https://volta.foundation/battery-report-2024"

    Updated Feb 14, 2025

> Tags

Pythonarchivalcourseracoursera-dldownloader

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具