riazXrazor / udemy-dl

Nodejs script to download a udemy.com course, for personal offline use
285 stars 68 forks source link

special character in the course title or in the lessson title will causing error #66

Closed cyflai closed 4 years ago

cyflai commented 4 years ago

seem if the course title has special characters like & ; - ( ) then there will be a split error

initializing... done
/usr/lib/node_modules/udemy-dl/src/lib/core.js:387
var file = query_obj.filename.split(".");
^

TypeError: Cannot read property 'split' of undefined

image

cyflai commented 4 years ago

the following courses won't work and will be displaying the split error, the last two courses also not working but the title of the course didn't have any special characters, maybe the lessons have the special characters?

Learn Flutter & Dart to Build iOS & Android Apps [2020] Music Theory Comprehensive Complete! (Levels 1, 2, & 3) The Complete Introduction To Music Theory Course The Complete 2020 Flutter Development Bootcamp with Dart

johndoe1969 commented 4 years ago

Agreed...a period(.), a colon(:), a dash(-), a vertical line(|), or an ampersand(&) in the course name have given me errors and won't download.

riazXrazor commented 4 years ago

let me fix this quick first

riazXrazor commented 4 years ago

@johndoe1969 @cyflai this is not the issue, udemy changed the internal json a bit so it was causing error, i fixed it and pushed a fix, let me kno if its working now.

johndoe1969 commented 4 years ago

Yes that seemed to fix it. However the course numbering is still off and is still making every file start with the number "1" which is kind of annoying.

riazXrazor commented 4 years ago

@johndoe1969 sorry it slipped my mind, will fix in next release :)