-
-
Notifications
You must be signed in to change notification settings - Fork 356
Description
First of all, thank you for this program. It works extremely well for backing up the Udemy courses I've purchased.
I ran into an issue with one of my courses that has very long chapter title and lecture titles which caused the path length to exceed the Windows 255 character limit. This caused lots of weird errors about "cannot write to file" or "file not found" during the download process.
Example (256 characters long): Z:\Udemy\out_dir\crash-course-electronics-and-pcb-design\08 - Graduating to Design Engineer_ CircuitMaker Fundamentals and Real-World Projects/004 CircuitMaker Fundamentals_ Magic Wand 555 Timer Design & Parts Selection Process.encrypted.m4a.part.frag.urls
I worked around the issue by putting the udemy-downloader folder in the root folder of my drive, renaming the udemy-downloader folder to just "Udemy", and finally I had to add a line to the main.py to truncate any chapter title greater than 51 characters:
for chapter in _udemy.get("chapters"):
chapter_title = chapter.get("chapter_title")
chapter_title = chapter_title[:51] <<<
chapter_index = chapter.get("chapter_index")
chapter_dir = os.path.join(course_dir, chapter_title)
if not os.path.exists(chapter_dir):
os.mkdir(chapter_dir)
This all worked fine for me but it might be worth adding a mechanism to detect if the program is going to try to access a path longer than 256 characters, and if so either just arbitrarily truncate the chapter titles and lecture titles if necessary, or give the user an option to select what to truncate and how much. Or even just print an error and quit rather than have the user receive lots of weird errors. For me, I figured the information in the long lecture titles was more useful so I opted to truncate the chapter titles. Although, I did add a txt file with the full chapter titles "just in case".
Just some thoughts I thought I'd share. Thanks again!