Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
added course number in download
Browse files Browse the repository at this point in the history
  • Loading branch information
riazXrazor committed May 9, 2018
1 parent 171e5ba commit d4fb0a0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ jspm_packages

# Yarn Integrity file
.yarn-integrity
.idea
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ npm install -g udemy-dl
```

### Version
**0.0.15**
**0.0.16**

### Usage

Expand Down Expand Up @@ -51,6 +51,7 @@ Options:


### Updates
- *(09/05/2018)* added course number in download.
- *(02/05/2018)* bug fixes to for code changes in udemy.
- *(02/05/2018)* Course materials are also downloaded now.
- *(08/12/2017)* added option to select resolution.
Expand Down
2 changes: 2 additions & 0 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ let check_course_status = function(course_id,cb){
}
var all_videos_list = [];
var download_queue = [];
var video_number = 1;

let get_data_links = function(course_id, lecture_start, lecture_end){
// """Getting video links from api 2.0."""
Expand Down Expand Up @@ -619,6 +620,7 @@ let check_course_status = function(course_id,cb){
element.title = json_source.title;
element.chapter = item.chapter;
element.resolution = argv.resolution;
element.number = video_number++;
download_queue.push(element);
//console.log(element);
callback();
Expand Down
2 changes: 1 addition & 1 deletion lib/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function download(dataObj,callback) {
var fileUrl = dataObj.data_url,
base_path = argv.output ? files.getCurrentDirectoryBase() + path.sep + argv.output : files.getCurrentDirectoryBase(),
//edited to get current file with its chapter number
title = sanitize(dataObj.title)+'.'+dataObj.extension,
title = dataObj.number+' - '+sanitize(dataObj.title)+'.'+dataObj.extension,
apiPath = base_path + path.sep + sanitize(dataObj.chapter) + path.sep + title,
total_size = 0,
total_downloaded = 0,
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d4fb0a0

Please sign in to comment.