r0oth3x49 / udemy-dl

A cross-platform python based utility to download courses from udemy for personal offline use.
MIT License
4.83k stars 1.19k forks source link

Lectures are (seemingly) randomly getting skipped #628

Closed acefalobi closed 3 years ago

acefalobi commented 3 years ago

I tried to download a course from a udemy account, it downloads some lectures, but others just get skipped with no errors or warnings. When I try to list the lectures, the same thing happens. It shows the number of lectures, but only lists some or none of them.

Udemy course URL: [https://softcom.udemy.com/course/machinelearning]. (I can email you the credentials if need be).

Command: python udemy-dl.py https://softcom.udemy.com/course/machinelearning/ to download and python udemy-dl.py https://softcom.udemy.com/course/machinelearning/ --info to list the lectures.

This is a snippet of what I get when I try to list the lectures:

...
[i] : Trying to login as (ace@softcom.ng)
[i] : Logged in successfully.
[+] : Downloaded course information ..  (done)
[i] : Trying to logout now...
[i] : Logged out successfully.
[+] : Course 'machinelearning'
[i] : Chapter(s) (45)
[i] : Lecture(s) (322)

[i] : Chapter (01 Welcome to the course!-1432236)
[i] : Lecture(s) (14)
     - duration   : 03:22.
     - Lecture id : 6087180.
    - hls:mp4@360            360p    
    - hls:mp4@432            432p    
    - hls:mp4@576            576p    
    - hls:mp4@720            720p    
    - hls:mp4@1080           1080p   
    - video:mp4@144          144p    2.07MB 
    - video:mp4@360          360p    3.83MB 
    - video:mp4@480          480p    5.29MB 
    - video:mp4@720          720p    7.99MB 
    - video:mp4@1080         1080p   9.81MB (Best)
    - subtitle:id@vtt        vtt     5.08KB
    - subtitle:fr@vtt        vtt     5.27KB
    - subtitle:de@vtt        vtt     5.04KB
    - subtitle:pt@vtt        vtt     5.07KB
    - subtitle:it@vtt        vtt     5.05KB
    - subtitle:es@vtt        vtt     4.91KB
    - subtitle:en@vtt        vtt     4.64KB
     - duration   : 05:40.
     - Lecture id : 5728004.
    - hls:mp4@360            360p    
    - hls:mp4@432            432p    
    - hls:mp4@576            576p    
    - hls:mp4@720            720p    
    - hls:mp4@1080           1080p   
    - video:mp4@360          360p    7.24MB 
    - video:mp4@480          480p    11.26MB 
    - video:mp4@720          720p    17.55MB 
    - video:mp4@1080         1080p   23.21MB (Best)
    - subtitle:en@vtt        vtt     7.94KB
    - subtitle:pt@vtt        vtt     8.17KB
    - subtitle:de@vtt        vtt     8.39KB
    - subtitle:es@vtt        vtt     8.02KB
    - subtitle:fr@vtt        vtt     8.41KB
    - subtitle:it@vtt        vtt     7.93KB

[i] : Chapter (02 -------------------- Part 1_ Data Preprocessing ---------------------4506024)
[i] : Lecture(s) (1)

[i] : Chapter (03 Data Preprocessing in Python-1422414)
[i] : Lecture(s) (9)

[i] : Chapter (04 Data Preprocessing in R-4506056)
[i] : Lecture(s) (10)
...

You can see that the first chapter says 14 lectures but only shows 2 and the following ones don't even show any at all.

acefalobi commented 3 years ago

After further investigation of the code, it seems the stream_urls parameter is null in some assets, even though they are videos. Any thoughts as to what might be causing this?

Example:

{
  '_class': 'asset',
  'asset_type': 'Video',
  'body': '',
  'captions': [...],
  'download_urls': None,
  'external_url': '',
  'filename': 'ML-is-the-future.mp4',
  'id': 7236304,
  'slide_urls': [],
  'stream_urls': None,
  'time_estimation': 397,
  'title': 'ML_is_the_future.mp4'
}
nChauhan91 commented 3 years ago

I think it's the same issue as this

https://github.com/r0oth3x49/udemy-dl/issues/627

acefalobi commented 3 years ago

True. Do you know why the stream_urls might be returning for some lecture videos and not others?

iaman1998 commented 3 years ago

I am facing the same issue.

r0oth3x49 commented 3 years ago

lets discuss the issue in #627, closing this as dup