Giter Site home page Giter Site logo

lyndadownloader's Introduction

By Navpreet Devpuri

Notes:

  1. When using LyndaDownloaderLearningPaths.py then make sure you opened that learning path and clicked on button Start learning.
  2. Run Python script LyndaDownloader.py :) and download 'Exercise Files' manually.
  3. If some error occurred or stoped while downloading then just restart python script it will repause download.
  4. If you started downloading some course then finish it as soon as possible because after some time link will be expire.

Step 1) register new card from here and get your card number. if you have an account then continue from step 3.

OR Just open browser console and run following script, It will generate ID

console.log("Generating ID...");
var res = await (await fetch("https://datas-1.sirsi.net/CTS/SON/selfRegistration.pl", {
  "headers": {
    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
    "accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
    "cache-control": "max-age=0",
    "content-type": "application/x-www-form-urlencoded",
    "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"90\", \"Google Chrome\";v=\"90\"",
    "sec-ch-ua-mobile": "?0",
    "sec-fetch-dest": "document",
    "sec-fetch-mode": "navigate",
    "sec-fetch-site": "cross-site",
    "sec-fetch-user": "?1",
    "upgrade-insecure-requests": "1"
  },
  "referrer": "https://find.sonomalibrary.org/",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": `patron_firstName=John&patron_lastName=Bailey&patron_birthDateEntry=04%2F13%2F2000&patron_birthDate=2000-04-13&patronAddress1_STREET=PO+BOX+338&patronAddress_cityST=bn&patronAddress1_POSTALCODE=95415-0338&patronAddress1_PHONE_Entry=231-412-4123&patronAddress1_PHONE=2314124123&patronAddress1_EMAIL=sdfasdfds%40gmail.com&patronAddress1_EMAIL_CONFIRM=sdfasdfds%40gmail.com&patron_pin=1234&patron_confirmPin=1234&patron_library=wind&patronExtendedInformation_NOFITY_VIA=email&user_profile=PUBLIC&enterprise_locale=en_US&enterprise_profile=default&registrationSubmit=Register`,
  "method": "POST",
  "mode": "cors",
  "credentials": "omit"
})).text(); 
var toFind = "eCard number is:";
var startIndex = res.indexOf(toFind) + toFind.length + 1; 
var endIndex = res.slice(startIndex).indexOf("</strong>");
var cardNumber = res.slice(startIndex, startIndex + endIndex);
console.log(`Login Link: https://www.lynda.com/portal/sip?org=sonomalibrary.org\nLibrary Card Number: ${cardNumber}\nPassword: 1234`) 

Step 2) login by using card number and password here

Step 3) open chrome's devloper option by pressing ctrl + shift + I then open networking tab and play any video then find 'play' in 'Request Headers' and copy cookies (bcooklie=....etc)

step 3

On windows

  1. Download and install Python3.x.x from link

  2. Make sure to check Add Python3 to PATH on first step of installation.

  3. Open CMD and run command pip3 install requests or pip install requests

  4. Know you can run python script on Windows

For example :
python 'C:\Users\navpreetdevpuri\Downloads\LyndaDownloader.py'
or
python 'C:\Users\navpreetdevpuri\Downloads\LyndaDownloader.py' -url 'https://www.lynda.com/C-tutorials/C-Essential-Training/772322-2.html' -savedir 'C:\Users\navpreetdevpuri\Downloads\' -q 2 

On Android (Its better to use Pydroid 3 instead of Termux)

You can also run this script in android (How to run python script on android ?)
  1. Download and install Termux app. (remember to give storage permission from phone's settings and turn off battery optimization for Termux app to make app run long)
  2. Run following commads :
    • apt-get update
    • apt-get install python
    • pip install requests
  3. Know you can run python script on android
    -savedir or -sd argument is compulsory for android.
For example :
python '/storage/emulated/0/Download/LyndaDownloader.py' -savedir '/storage/emulated/0/Download/'
or
python '/storage/emulated/0/Download/LyndaDownloader.py' -url 'https://www.lynda.com/C-tutorials/C-Essential-Training/772322-2.html' -savedir '/storage/emulated/0/Download/' -q 2 

On Linux

  1. Run following commads to install Python:
    • sudo apt-get update
    • sudo apt-get -y install python3
    • sudo apt-get -y install python3-pip
    • sudo pip3 install requests or pip install requests
  2. Know you can run python script on Linux
For example :
python3 '/home/navpreetdevpuri/Downloads/LyndaDownloader.py'
or
python3 '/home/navpreetdevpuri/Downloads/LyndaDownloader.py' -url 'https://www.lynda.com/C-tutorials/C-Essential-Training/772322-2.html' -sd '/home/navpreetdevpuri/Downloads/' -quality 720p 

Optional arguments with python script

If you run script without this arguments then It will ask this things on run time

  1. -url : Url link of Lynda course.
  2. -savedir or -sd : Directory location (Full path) on your system where you want to save files (by default set to the same location as LyndaDownloader.py).
  3. -quality or -q : Video quality (360p or 0, 540p or 1, 720p or 2).
  4. -fromfolder or -ff : In case you want to download only few topics by entring starting topic number (by default set to 1 which means start download from 1st topic of course).

lyndadownloader's People

Contributors

navpreetdevpuri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lyndadownloader's Issues

HoustonLibrary

Your HoustonLibrary cookies not work anymore ... can you give everyone can edit cookies self?

Im getting a new issue - KeyError: 'content-length'

Getting error while downloading a learning path https://www.lynda.com/learning-paths/IT/become-an-ethical-hacker
###11. Ethical Hacking Evading IDS Firewalls and Honeypots (1h 52m)#####

`Downloading...
0. Introduction:
[540p: 3.4Mb] 1. Find weaknesses in the perimeter (1m 37s).mp4
[540p: 0.9Mb] 2. What you should know (43s).mp4
[540p: 1.49Mb] 3. Course disclaimer (1m 10s).mp4

  1. Firewalls:
    [540p: 1.31Mb] 1. Understanding Firewalls (1m 2s).mp4
    [540p: 10.4Mb] 2. Apply the basics of the Windows firewall (5m 17s).mp4
    [540p: 14.58Mb] 3. Use advanced features in the Windows Firewall (8m 18s).mp4
    [540p: 6.02Mb] 4. Review firewall logs (3m 22s).mp4
    [540p: 7.16Mb] 5. Understand Linux IPTables (4m 14s).mp4
    [540p: 4.68Mb] 6. Set up an IPTables firewall (2m 52s).mp4
    [540p: 12.45Mb] 7. Manage rules with Firewall Builder (8m 24s).mp4
    [540p: 1.45Mb] 8. Port testing (1m 7s).mp4
  2. Hardware Firewalls:
    [540p: 5.91Mb] 1. Set up a Cisco PIX firewall (3m 15s).mp4
    100.00% (5.91Mb/5.91Mb) Allover:53.93% (109.62Mb/203.27Mb)
    Traceback (most recent call last):
    File "/content/LyndaDownloader/LyndaDownloaderLearningPaths.py", line 412, in
    download()
    File "/content/LyndaDownloader/LyndaDownloaderLearningPaths.py", line 136, in download
    'https://www.lynda.com/ajax/player/transcript?courseId=' + courseId + '&videoId=' + data[i][1][j][1][0], header=h, showOutput=False)
    File "/content/LyndaDownloader/LyndaDownloaderLearningPaths.py", line 160, in dowloadFile
    size = int(r.headers['Content-length'])
    File "/usr/local/lib/python3.6/dist-packages/requests/structures.py", line 54, in getitem
    return self._store[key.lower()][1]
    KeyError: 'content-length'`

Issue while downloading a learning path -ValueError: invalid literal for int() with base 10: ' Queues'

im getting below error while downloading this learning path - https://www.lynda.com/learning-paths/Developer/advance-your-skills-in-python

Please help.
the first 3 courses downloaded successfully but this one gets stuck always.

4. Python Data Structures  Stacks, Queues, and Deques (1h 24m)
 Total Videos : 33
    [360p:107.58Mb, 540p:147.7Mb, 720p:203.34Mb]
 
    [360p:107.58Mb, 540p:147.7Mb, 720p:203.34Mb]
Enter video quality (0 for 360p, 1 for 540p or 2 for 720p) : 2
Traceback (most recent call last):
  File "/content/LyndaDownloader/LyndaDownloaderLearningPaths.py", line 414, in <module>
    download()
  File "/content/LyndaDownloader/LyndaDownloaderLearningPaths.py", line 97, in download
    downloadedsize = int(temp[1])
ValueError: invalid literal for int() with base 10: ' Queues'

IndexError: list index out of range

Traceback (most recent call last):
File "/Drive/drive/_lynda_course_downloader/LyndaDownloader/LyndaDownloader.py", line 191, in getVideosLinks
videodata[1]['urls']['720']
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Drive/drive/_lynda_course_downloader/LyndaDownloader/LyndaDownloader.py", line 194, in getVideosLinks
videodata[1]['urls']['540']
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Drive/drive/_lynda_course_downloader/LyndaDownloader/LyndaDownloader.py", line 322, in
getVideosLinks()
File "/Drive/drive/_lynda_course_downloader/LyndaDownloader/LyndaDownloader.py", line 197, in getVideosLinks
[videodata[1]['urls']['360']])
IndexError: list index out of range

Udemy

Doyou have plan to udemy supports?

I got an error.

I got an error like this :

Exercise File: exFile 11._Ethical_Hacking_Evading_IDS,_Firewalls,and_Honeypots(1h_52m) [0.34Mb]
11. Ethical Hacking Evading IDS, Firewalls, and Honeypots (1h 52m)
Total Videos : 31
[360p:156.91Mb, 540p:203.27Mb, 720p:329.39Mb]

[360p:156.91Mb, 540p:203.27Mb, 720p:329.39Mb]

Traceback (most recent call last):
File "/content/LyndaDownloader/LyndaDownloaderLearningPaths.py", line 414, in
download()
File "/content/LyndaDownloader/LyndaDownloaderLearningPaths.py", line 97, in download
downloadedsize = int(temp[1])
ValueError: invalid literal for int() with base 10: ' Firewalls'

Having an issue installing Pip

C:\Users\usernamehere >pip install requests
'pip' is not recognized as an internal or external command,
operable program or batch file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.