Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Commit

Permalink
udemy-dl v0.4, added feature to download specific chapter, chapter(s)…
Browse files Browse the repository at this point in the history
… range, lecture or lecture(s) from chapter or chapter(s) range. replaced some old option with new one.
  • Loading branch information
r0oth3x49 committed Feb 26, 2018
1 parent 87689e9 commit aa7a872
Show file tree
Hide file tree
Showing 27 changed files with 3,439 additions and 1,926 deletions.
90 changes: 90 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
.venv/
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject
1 change: 1 addition & 0 deletions AUTHOR
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Nasir Khan (r0ot h3x49)
45 changes: 45 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Change Log

## 0.4 (2018-02-26)

Features:
- Download spacific chapter in a course (option: `-c / --chapter`) thanks to @alfari16.
- Download chapter(s) by providing range in a course (option: `--chapter-start, --chapter-end`).
- Download specific lecture in a chapter (option: `-l / --lecture`).
- Download lecture(s) by providing range in a chapter (option: `--lecture-start, --lecture-end`).
- Changed (option: `-l / --list-infos`) by (option: `--info`).
- Changed (option: `-c / --configs`) by (option: `--cache`).
- Changed (option: `-s / --save-links`) by (option: `--save`).
- Changed (option: `-r / --resolution`) by (option: `-q / --quality`).
- Removed (option: `-d / --get-default`).

## 0.3 (2017-11-14)

Features:
- Skip captions/subtitle and download course only (option: `--skip-sub`).
- Download captions/subtitle only thanks to @leo459028 (option: `--sub-only`).
- Edit the password by pressing backspace on command line.

Bugfixes:
- Fixed some issues & improved code quality for Python3.
- Fixed #13 (UnicodeEncodeError) thanks for quick patch by @jdsantiagojr.

## 0.2 (2017-08-29)

Features:
- Download the default quality if requested quality is not there (option: `-d / --get-default`).
- Cache the credentials to file and use it later for login purpose (option: `-c / --configs`).
- Get user input if no credentials provided using command line argument.

Bugfixes:
- Updated code for downloading captions (subtitles) if available.


## 0.1 (2017-08-01)

Features:
- Resume capability for a course video.
- Saves direct download links to a file, If you don't want to download.
- Downloads all available subtitles if any attached with video.
- List down all available resolution for a video in a course.
- Saves course to user provided path (directory), default is current directory.
12 changes: 12 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Copyright (c) 2018 Nasir Khan (r0ot h3x49)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
185 changes: 59 additions & 126 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
[![GitHub release](https://img.shields.io/badge/release-v0.3-brightgreen.svg?style=flat-square)](https://github.com/r0oth3x49/udemy-dl/releases/tag/v0.3)
[![GitHub stars](https://img.shields.io/github/stars/r0oth3x49/udemy-dl.svg?style=flat-square)](https://github.com/r0oth3x49/udemy-dl/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/r0oth3x49/udemy-dl.svg?style=flat-square)](https://github.com/r0oth3x49/udemy-dl/network)
[![GitHub issues](https://img.shields.io/github/issues/r0oth3x49/udemy-dl.svg?style=flat-square)](https://github.com/r0oth3x49/udemy-dl/issues)

# udemy-dl
**A cross-platform python based utility to download courses from udemy for personal offline use.**

[![udemy-dl.gif](https://s26.postimg.org/st8y7ud5l/udemy-dl.gif)](https://postimg.org/image/y4nusjz85/)
[![udemy.png](https://s26.postimg.org/fo84ef1qx/udemy.png)](https://postimg.org/image/brusifgr9/)

### Requirements
## ***Features***

- Resume capability for a course video.
- Supports organization and individual udemy users both.
- Save course direct download links to a text file (option: `--save`).
- Cache credentials to a file and use it later for login purpose (option: `--cache`).
- List down course contents and video resolution, suggest the best resolution (option: `--info`).
- Download/skip all available subtitles for a video (options: `--skip-sub, --skip-sub`).
- Download spacific chapter in a course (option: `-c / --chapter`).
- Download specific lecture in a chapter (option: `-l / --lecture`).
- Download chapter(s) by providing range in a course (option: `--chapter-start, --chapter-end`).
- Download lecture(s) by providing range in a chapter (option: `--lecture-start, --lecture-end`).
- Download lecture(s) requested resolution (option: `-q / --quality`).
- Download course to user requested path (option: `-o / --output`).


## ***Requirements***

- Python (2 or 3)
- Python `pip`
Expand All @@ -18,147 +33,65 @@
- Python module `six`
- Python module `requests[security]` or `pyOpenSSL`

### Install modules
## ***Install modules***

pip install -r requirements.txt

### Tested on
## ***Tested on***

- Windows 7/8/8.1
- Windows 7/8/8.1/10
- Kali linux (2017.2)
- Ubuntu-LTS (64-bit) (tested with super user)
- Mac OSX 10.9.5 (tested with super user)

### Download udemy-dl
## ***Download/clone udemy-dl***

You can download the latest version of udemy-dl by cloning the GitHub repository.

git clone https://github.com/r0oth3x49/udemy-dl.git

### Updates

- Added feature to download the default quality if requested quality is not there.
- Added feature to cache the credentials to file and use it later for login purpose.
- Added feature to get user input if no credentials provided using command line argument.
- Updated code for downloading captions (subtitles) if available.


### Change-log

- Fixed some issues & improved code quality for Python3.
- Fixed #13 (UnicodeEncodeError) thanks for quick patch by @jdsantiagojr
- Added feature to skip captions/subtitle and download course only.
- Added feature to download captions/subtitle only thanks to @leo459028.
- Added feature to edit the password by pressing backspace on command line.

### Configuration

<pre><code>


{
"username" : "[email protected]",
"password" : "p4ssw0rd",
"output" : "path/to/directory/",
"resolution" : "1080"
}

Example for windows users to set output directory:
"output" : "path\\to\\directory"

</code></pre>


### Usage

***Downloading course***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL

***Downloading Course with specific resolution***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL -r 720

***Downloading course to a specific location***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL -o "/path/to/directory/"

***Downloading course with specific resolution to a specific location***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL -r 720 -o "/path/to/directory/"

***Saving download links***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL -s

***Saving specific resolution download links***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL -s -r 720

***Saving download links to specific location***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL -s -o "/path/to/directory/"

***Saving specific resolution download links to specific location***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL -s -r 720 -o "/path/to/directory/"

***Downloading course and caching credentials***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL --configs

***Downloading with specific resolution and allow default resolution as well***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL -r 1080 -d

***Downloading course but skip captions/subtitles***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL --skip-sub

***Downloading captions/subtitles only***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL --sub-only

***Listing course's video informtion***

python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL -l
the above command will list down the size of video and attached files and available resolutions for a video in a course.

### Advanced Usage
## Advanced Usage

<pre><code>
Author: Nasir khan (<a href="http://r0oth3x49.herokuapp.com/">r0ot h3x49</a>)

Usage: udemy-dl.py [-h] [-u "username"] [-p "password"] COURSE_URL
[-s] [-l] [-r "resolution"] [-o "/path/to/directory/"]
[-d] [-c/--configs] [--sub-only] [--skip-sub]
Usage: udemy-dl.py [-h] [-v] [-u] [-p] [-o] [-q] [-c] [-l] [--chapter-start]
[--chapter-end] [--lecture-start] [--lecture-end] [--save]
[--info] [--cache] [--sub-only] [--skip-sub]
course

A cross-platform python based utility to download courses from udemy for
personal offline use.

Options:
General:
-h, --help Shows the help.
-v, --version Shows the version.

Advance:
-u, --username Username in udemy.
-p, --password Password of your account.
-c, --configs Cache your credentials to use it later.
-s, --save-links Do not download but save links to a file.
-l, --list-infos List all lectures with available resolution.
-r, --resolution Download video resolution, default resolution is 720p.
-d, --get-default Download default resolution if requested not there.
-o, --output Output directory where the videos will be saved,
default is current directory.

Others:
--sub-only Download captions/subtitle only.
--skip-sub Download course but skip captions/subtitle.

Example:
python udemy-dl.py COURSE_URL
positional arguments:
course Udemy course.

General:
-h, --help Shows the help.
-v, --version Shows the version.

Authentication:
-u , --username Username in udemy.
-p , --password Password of your account.

Advance:
-o , --output Download to specific directory.
-q , --quality Download specific video quality.
-c , --chapter Download specific chapter from course.
-l , --lecture Download specific lecture from chapter(s).
--chapter-start Download from specific position within course.
--chapter-end Download till specific position within course.
--lecture-start Download from specific position within chapter(s).
--lecture-end Download till specific position within chapter(s).

Others:
--save Do not download but save links to a file.
--info List all lectures with available resolution.
--cache Cache your credentials to use it later.
--sub-only Download captions/subtitle only.
--skip-sub Download course but skip captions/subtitle.

Example:
python udemy-dl.py COURSE_URL
python udemy-dl.py -u [email protected] -p p4ssw0rd COURSE_URL
</code></pre>


### Note
<pre><code>Do not change the position of any argument as given under the Usage, this may cause an error or failur in downloading of course.</code></pre>
Loading

0 comments on commit aa7a872

Please sign in to comment.