Skip to main content

Script for downloading Coursera.org videos and naming them.

Project description

Build Status Coverage Status Code Climate Latest version on PyPI

coursera-helper

coursera-helper is forked from coursera-dl which is no longer maintained.

Introduction

coursera-helper is a tool for downloading Coursera.org videos and naming them..

It is platform independent, and should work fine under Unix (Linux, BSDs etc.), Windows or Mac OS X.

Installation instructions

coursera-helper requires Python 3 and very few other dependencies. (As of October 2023, coursera-helper passed the test of Python versions 3.8, 3.9, 3.10, and 3.11).

Installation (recommended)

Opening a terminal and typing the command If you have installed Python:

pip install coursera-helper

Manual Installation

pip install git+https://github.com/csyezheng/coursera-helper.git

Docker container

You can run this application via Docker if you want. Just install docker and run

docker run --rm -it -v \
    "$(pwd):/courses" \
     csyezheng/coursera-helper --cauth <CAUTH-value> <course name>
  • Please note that it will prompt that unable to find the image locally, please wait patiently for downloading.

  • Please note that when running in docker mode, only the --cauth parameter can be passed for authentication, and username, password, and --browser-cookie parameters are not accepted.

  • The course files will be downloaded to your current directory.

Before the start

coursera-helper supports four authentication methods:

  1. CAUTH (recommended)

    Just use the --cauth CAUTH-value-from-browser option when running the program.

    How to get the cauth value?

  2. Browser cookies

    Just use the --browser-cookie option when running the program.

    Automatically extract CAUTH value from the browser cookie. If this method fails, please use other authentication methods.

  3. Username and Password

    Just use the -u <user> -p <pass> options when running the program.

    Please note that this method will open the browser, you may have to click on the reCAPTCHA.

  4. netrc File

    Just use the --netrc options when running the program.

Quick Start

Run the following command to query the usage and options:

coursera-helper --help

List courses

Run the following command to query the courses in which you are enrolled:

coursera-helper --cauth <CAUTH> --list-courses

or

coursera-helper --browser-cookie --list-courses

or

coursera-helper -u <email or username> --list-courses

Download course

From there, choose the course you are interested in, copy its course name and use it in the following command:

coursera-helper -u <email or username> <COURSE NAME>

Your downloaded videos will be placed in current directory, but you can also choose another destination with the --path argument.

More download options

General download:

coursera-helper --cauth <CAUTH> <COURSE NAME>

Specify download location:

coursera-helper --cauth <CAUTH> --path <PATH> <COURSE NAME>

Download with subtitles:

coursera-helper --cauth <CAUTH> --subtitle-language en,zh-CN|zh-TW <COURSE NAME>

Specify video resolution:

coursera-helper --cauth <CAUTH> --video-resolution 720p <COURSE NAME>

Download with quizzes:

coursera-helper --cauth <CAUTH> --download-quizzes <COURSE NAME>

Download with notebooks:

coursera-helper --cauth <CAUTH> --download-notebooks <COURSE NAME>

Use configuration file

Alternatively, if you want to store your preferred parameters (which might also include your username and password), create a file named coursera-dl.conf where the script is supposed to be executed, with the following format:

--username <user>
--password <pass>
--subtitle-language en,zh-CN|zh-TW
--download-quizzes
--download-notebooks
--video-resolution 720p
--download-delay 10
--cauth <cauth value>

If you have created a file named coursera-dl.conf, you just download course with command:

coursera-helper <COURSE NAME>

Troubleshooting

CAUTH

Find your coursera CAUTH:

Chrome:

  1. Open the browser and login to https://www.coursera.org/

  2. Open the last DevTools panel

    Windows or Linux: Press F12 on the keyboard. Or press the Ctrl + Shift + I keys.

    Mac: Press Fn + F12 on the keyboard. Or press the Cmd + Option + I keys.

  3. Open Application > Storage > Cookies and select https://www.coursera.org/.

  4. find and click CAUTH > Copy value CAUTH

Firefox:

  1. Open the browser and login to https://www.coursera.org/

  2. Open the last DevTools panel

    Windows or Linux: Press F12 on the keyboard. Or press the Ctrl + Shift + I keys.

    Mac: Press Fn + F12 on the keyboard. Or press the Cmd + Option + I keys.

  3. Open Storage > Cookies and select https://www.coursera.org/.

  4. find and click CAUTH > Copy value CAUTH

china-issues

If you are from China and you're having problems downloading videos, adding

52.84.167.78   d3c33hcgiwev3.cloudfront.net

in the hosts file (/etc/hosts or C:\Windows\System32\drivers\etc)

Flush DNS with this command in the terminal.

ipconfig /flushdns

Reporting issues

Before reporting any issue please follow the steps below:

  1. Verify that you are running the latest version of all the programs. Use the following command if in doubt:

     pip install --upgrade coursera-helper
    
  2. If the problem persists, feel free to open an issue in our bug tracker, please fill the issue template with as much information as possible.

Disclaimer

coursera-helper 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coursera_helper-0.12.3.tar.gz (215.8 kB view details)

Uploaded Source

Built Distribution

coursera_helper-0.12.3-py2.py3-none-any.whl (62.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file coursera_helper-0.12.3.tar.gz.

File metadata

  • Download URL: coursera_helper-0.12.3.tar.gz
  • Upload date:
  • Size: 215.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for coursera_helper-0.12.3.tar.gz
Algorithm Hash digest
SHA256 d5cd5e288d67bcb90e7510ecb922adba6fb4f5b0e7587aea91c283a063d7e1c3
MD5 4209cec109e1c04e38792fde0a88b327
BLAKE2b-256 4750f04df3aea3fb48eb1e7ec5be3b7dbae70f3f7e9b646a96d08553fbf935bd

See more details on using hashes here.

File details

Details for the file coursera_helper-0.12.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for coursera_helper-0.12.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2dd5188f70871e124c81c89079770b93903ccb9c95bf906973ab670535d0a55d
MD5 61f85cc7be4f4269ddffdae42213d040
BLAKE2b-256 7c162f303741550c85199f7c275dd8371ceafc2e69c7769f44e00454e0f774d5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page