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 40f02c0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 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
39 changes: 27 additions & 12 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 @@ -92,6 +95,18 @@ coursera-helper --help

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

From there, choose the course you are interested in, copy its course name and use it
Expand All @@ -112,31 +127,31 @@ execute:
General download:

```
coursera-helper -u <user> data-analysis-with-python
coursera-helper --cauth <CAUTH> -p <pass> data-analysis-with-python
```

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 data-analysis-with-python
```

Specify video resolution:

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

Download with quizzes:

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

Download with notebooks:

```
coursera-helper -u <user> --download-notebooks data-analysis-with-python
coursera-helper --cauth <CAUTH> --download-notebooks data-analysis-with-python
```

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,7 +164,7 @@ 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:
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 40f02c0

Please sign in to comment.