r0oth3x49 / lynda-dl

A cross-platform python based utility to download courses from lynda.com for personal offline use.
MIT License
295 stars 95 forks source link

only .srt and exercise are downloaded for some courses #10

Closed Mozenrat closed 6 years ago

Mozenrat commented 6 years ago

Example: "Motion: Principles of Motion Graphics" No video files, only .srt and exercise files are downloaded for it.

r0oth3x49 commented 6 years ago

@Mozenrat the reason may be lynda-dl don't download videos in m3u8 stream but a simple .mp4

Mozenrat commented 6 years ago

@r0oth3x49, I'm not sure was it related to video format m3u8 or a simple .mp4 when I was trying to download. But I just tried Free Video Download extension for Chrome and it's able to detect and save video as .mp4. Tried lynda-dl once again, but this time it downloads nothing and just fails with following errors:

[*] : Logged in successfully.
[*] : Downloading course information webpages ..
Traceback (most recent call last):
  File "C:\Users\usver\scripts\lynda-dl\lynda-dl.py", line 433, in <module>
    main()
  File "C:\Users\usver\scripts\lynda-dl\lynda-dl.py", line 405, in main
    lynda.InfoExtractor()
  File "C:\Users\usver\scripts\lynda-dl\lynda-dl.py", line 113, in InfoExtractor
    videos_dict = extract_info.real_extract(self.url, course_path)
  File "C:\Users\usver\scripts\lynda-dl\lynda\_extractor.py", line 213, in real_extract
    course              = session.get(curl).json()
  File "C:\Users\usver\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Users\usver\AppData\Local\Programs\Python\Python36-32\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "C:\Users\usver\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\usver\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 3 (char 2)

Course URL: https://www.lynda.com/Motion-tutorials/Welcome/75925/80448-4.html

rinodung commented 6 years ago

confirm this error: https://www.lynda.com/Drupal-tutorials/Managing-content-Drupal/73655/78769-4.html I checked video with mp4 video

rackyman commented 6 years ago

The JSONDecodeError happens when the link entered points to a specific video, and not the course.

https://www.lynda.com/Motion-tutorials/Welcome/75925/80448-4.html is the link of the 1st Video

Whereas, https://www.lynda.com/Motion-4-tutorials/motion-creating-motion-graphics/75925-2.html is the link of the course. Lynda-DL only supports main course link.

rackyman commented 6 years ago

However, even with the main course link (https://www.lynda.com/Motion-4-tutorials/motion-creating-motion-graphics/75925-2.html).

Lynda-Dl is still downloading the subs and exercise files and not the videos.

The ajax request for the videos of this course is returning null json.

https://www.lynda.com/ajax/course/{course-id}/{video-id}/play should return the urls, but is returning [] for this course's videos, which is why lynda-dl can't download vids

I maybe wrong, but this might be the reason.

r0oth3x49 commented 6 years ago

@rackyman thanks for your support and explanation. @Mozenrat, @rinodung both of you should use the BASE_URL of course rather then giving link of the video.

rinodung commented 6 years ago

@r0oth3x49 what is BASE_URL meaning??? Example: https://www.lynda.com/Drupal-tutorials/Managing-content-Drupal/73655/78769-4.html BASE_URL: ???

rackyman commented 6 years ago

@rinodung BASE_URL is the main course url.

For your example, this is the base/course url : https://www.lynda.com/Drupal-7-tutorials/essential-training/73655-2.html

rinodung commented 6 years ago

thank you so much, Bro!