Skip to content

Commit

Permalink
Update README.md; Update python version of docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
csyezheng committed Oct 15, 2023
1 parent 61c7dc0 commit 4bc9a78
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6-slim
FROM python:3.11-slim

LABEL maintainer "https://github.com/csyezheng/"

Expand Down
58 changes: 40 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ It is platform independent, and should work fine under Unix (Linux, BSDs etc.),

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

python -m pip install coursera-helper
pip install coursera-helper

### Manual Installation

To install all the dependencies please do:

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

### Docker container

Expand All @@ -53,16 +51,21 @@ You can run this application via [Docker](https://docker.com) if you want. Just
```
docker run --rm -it -v \
"$(pwd):/courses" \
coursera-helper/coursera_helper -u <USER> -p <PASSWORD>
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.
Just use the `--cauth CAUTH-value-from-browser` option when running the program.

[How to get the cauth value?](#CAUTH)

Expand Down Expand Up @@ -90,55 +93,74 @@ 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.

To see all available options and a brief description of what they do, simply
execute:

coursera-helper --help
### More download options

General download:

### Examples
```
coursera-helper --cauth <CAUTH> <COURSE NAME>
```

General download:
Specify download location:

```
coursera-helper -u <user> data-analysis-with-python
coursera-helper --cauth <CAUTH> --path <PATH> <COURSE NAME>
```

Download with subtitles:

```
coursera-helper -u <user> --subtitle-language en,zh-CN|zh-TW data-analysis-with-python
coursera-helper --cauth <CAUTH> --subtitle-language en,zh-CN|zh-TW <COURSE NAME>
```

Specify video resolution:

```
coursera-helper -u <user> --video-resolution 720p data-analysis-with-python
coursera-helper --cauth <CAUTH> --video-resolution 720p <COURSE NAME>
```

Download with quizzes:

```
coursera-helper -u <user> --download-quizzes data-analysis-with-python
coursera-helper --cauth <CAUTH> --download-quizzes <COURSE NAME>
```

Download with notebooks:

```
coursera-helper -u <user> --download-notebooks data-analysis-with-python
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:

```
Expand All @@ -149,13 +171,13 @@ Alternatively, if you want to store your preferred parameters (which might also
--download-notebooks
--video-resolution 720p
--download-delay 10
-cauth <cauth value>
--cauth <cauth value>
```

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

```
coursera-helper data-analysis-with-python
coursera-helper <COURSE NAME>
```

## Troubleshooting
Expand Down
2 changes: 1 addition & 1 deletion coursera-helper.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ rem location of this .bat file) via Python, passing all user-specified arguments

rem Fixed the issue of spaces in the PATH name adding quotes before the batch Windows commands for drive and path. It should work fine now.
rem This issue was tested with pretty nasty path names (i.e. "t h i s i s t e r r i b l e") and it worked.
python "%~dp0\coursera-helper" %*
python "coursera-helper" %*

0 comments on commit 4bc9a78

Please sign in to comment.