riazXrazor / udemy-dl

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

Bugfix for Issue 14 - Unknown resolution #25

Closed jonathanoster closed 6 years ago

jonathanoster commented 6 years ago

Hello,

Going to preface the message with a note that I'm not an engineer and this would be the first time ever using git so I'm not 100% certain I got it all right. If I did the steps correctly I should have committed a bugfix to a new branch that resolved the bug reported as Issue 14 for udemy-dl. The problem I (and likely other users) were running into was that there were select chapters for a given lesson that were not available in the same resolution as the rest of the course.

I resolved this by changing the if(!url) check into a while loop failing back to progressively lower resolutions until a valid url was found. This allowed the majority of the course to be downloaded in my preferred resolution and each individual course unavailable in that resolution to continue through at the next available.

The resolution printed to the console during download still appears to be displayed as my max preference instead of what is used for that individual download, but I was unable to see where to make that edit.

-Jonathan

riazXrazor commented 6 years ago

thank you very much @jonathanoster for looking into it 👍 , i'll go through the changes and make some refinements if needed, and will soon merge it.