~tieong/download-course

58d1c353582946defd4114aa9f5f004c8f89c7cb — Thomas Ieong 2 years ago 74a713b
Updated README
2 files changed, 16 insertions(+), 13 deletions(-)

M README.md
D TODO
M README.md => README.md +16 -8
@@ 3,6 3,22 @@
Short script to download courses from the REPLACE_ME platform.
Need to set the username and the password as environment variables.


```
usage: download_course.py [-h] --city CITY [--promotion PROMOTION] [-o OUTPUT_DIR] [--debug]

options:
  -h, --help            show this help message and exit
  --city CITY           The city to select the correct REPLACE_ME platform.
  --promotion PROMOTION
                        The exact promotion name and year, ex: 'REPLACE_MEREPLACE_ME'
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Output dir, Default is current dir
  --debug               Verbose output.
```

## Usage

```
export REPLACE_ME_USERNAME=<username>
export REPLACE_ME_PASSWORD=<password>


@@ 13,11 29,3 @@ or

REPLACE_ME_USERNAME=<user> REPLACE_ME_PASSWORD=<password> download_course --city REPLACE_ME --promotion REPLACE_MEREPLACE_ME -o ~/Téléchargements
```

## Bug

- When the files have the same names (index.html, corrige.html) they will get redownloaded
  every time, because we only store in the json the name of the file and the etag, needs
  to store the file location as well.

  So far this only happened for like 4-5 files on the 300~ files available.

D TODO => TODO +0 -5
@@ 1,5 0,0 @@
- Need to refactor the get_materials, use recursion instead of for loops

- Fix the duplicates file name bug

- For the password prompt use getpass or env variables
\ No newline at end of file