maabiddevra / udemy-dl

A command line base Udemy video downloader for all platform, created in go lang.
32 stars 10 forks source link

it fails when videos do not have a consecutive id #1

Closed dportabella closed 3 years ago

dportabella commented 3 years ago

error downloading this course:

./udemy-dl-mac -access-token ...  
[*] : Authenticating Access Token...
[+] : Succesfully Authenticated
[*] : Fetching courses...
[+] : Courses
   -[452918] : From 1K to swimming 4K 
[?] : Enter the course Id which you want to download: 452918
[*] : Fetching course lectures...
[+] : Lectures
   -[1] : Why is WEST the healthiest swimming technique in the world.[Video] 
   -[2] : Ori Talking in TEDx Nicosia About the power of the sea- breaking a world record.[Video] 
   -[5] : Before you start, How to take your workout to the pool?[Video] 
   -[6] : Diagnose yourself according to your flexibility level[Video] 
   -[9] : Learn freestyle 2[Video] 
   -[10] : 13B- Gliding period of 2 sec[Video] 
   -[11] : 5B- Depth stretch[Video] 
   -[12] : Stretching 1- Hand on chest stretch[Video] 
   -[13] : Stretching 2- Hands behind the back holding the wall stretch[Video] 
   -[14] : 1B- Palm opened and loose[Video] 
   -[15] : Stretching 4- Fin Stretch[Video] 
   -[16] : Learn backstroke 7- Timing our breathe[Video] 
   -[19] : 6B- Legs position in water[Video] 
   -[20] : Drill 21- "superman 5sec"[Video] 
   -[21] : Drill 24- Breathing position[Video] 
   -[22] : 10B- Timing our breathing[Video] 
   -[23] : 11B- Bubbles[Video] 
   -[24] : 12B- Breathing position[Video] 
   -[25] : Stretching 6- head to knee stretch[Video] 
   -[27] : 2B- Angle between arm and forearm[Video] 
   -[28] : 3B- Elbow above water[Video] 
   -[29] : 7B- Ending of the pull[Video] 
   -[30] : 9B- Pushing the wall[Video] 
   -[32] : Pulse in swimming[Video] 
   -[33] : learn freestyle 10- Holy triangle of WEST[Video] 
   -[34] : Stretching 3- Hands behind the back standing[Video] 
   -[35] : Stretching 10- Arrow stretch[Video] 
   -[37] : Learn freestyle 9- Count number of strokes[Video] 
   -[39] : Shoulder Pain 1- loosening your shoulder with fins[Video] 
   -[40] : Stretching 5- Knee stretch[Video] 
   -[41] : Stretching 7- Toes on the wall stretch[Video] 
   -[43] : Learn backstroke 6[Video] 
   -[44] : Drill 12- Long doggie paddle[Video] 
   -[45] : 4B- Angle of the palm[Video] 
   -[46] : 14B- The pull[Video] 
   -[47] : Adjustment before swimming 6[Video] 
   -[49] : 8B- Head position[Video] 
[?] : Enter the lecture id from start download: 37
[?] : Enter the lecture id till you want download: 49
[?] : Enter the video Resolution(360/480/720/1080): 720
   - Downloading : Learn freestyle 9- Count number of strokes(87.00 MB/87.00 MB)[x] Dont have any valid download link, try with different resolution
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x126b3d9]

goroutine 1 [running]:
main.Download(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /Users/mohammedaabiddevra/projects/test/golang/udemy-dl/main.go:362 +0x239
main.(*Udemy).startDownloading(0xc0000d9f28, 0xc0005a0000, 0x40, 0x40)
    /Users/mohammedaabiddevra/projects/test/golang/udemy-dl/main.go:349 +0x116
main.main()
    /Users/mohammedaabiddevra/projects/test/golang/udemy-dl/main.go:137 +0x3d9

Here it downloads video 37, as requested, and it fails when starting to download video 38. Same happens when trying to download video 3, as it goes not exist.

maabiddevra commented 3 years ago

@dportabella I see it messed up with indexing, will fix it soon. thanks

f4him commented 3 years ago

same issue

maabiddevra commented 3 years ago

@dportabella @f4him Issue is fixed