Download NPTEL Video lectures (MP4 / FLV) without going through NPTEL Website

In this tutorial, I will explain how we can  download NPTEL Video lectures (MP4 / FLV) without going through NPTEL Website.  We use GNU/Linux Operating System and ‘wget’ tool for achieving this.

The downloadable NPTEL Video lectures are provided in the following website
http://npteldownloads.iitm.ac.in

1.  Store the NPTEL Course ID for Automatic Downloading

For automatic downloading, we need the NPTEL Course ID to be stored in a directory.  For example, we want to download the video lectures of ‘Software Engineering’ and ‘Cryptography and Network Security’ from Computer Science and Engineering discipline.

The course ID of ‘Software Engineering’ is (106101061) and ‘Cryptography and Network Security’ is (106105031).  Now create directory in the name of the Video courses as below.

[baskar@baskar ~]$ mkdir “Software Engineering”
[baskar@baskar ~]$ mkdir “Cryptography and Network Security”
[baskar@baskar ~]$

Now, change to ‘Software Engineering’ directory and save the course ID in the file ‘course.id’

[baskar@baskar ~]$ cd Software\ Engineering/
[baskar@baskar Software Engineering]$ echo 106101061 > course.id
[baskar@baskar Software Engineering]$

Now, the Course ID of ‘Software Engineering’ is stored in a file called ‘course.id’.

2.  NPTEL Video Courses Download links

Go to NPTEL website for getting the download link details for the particular course.  I have given the link as an example for the above two courses.

Software Engineering

(http://npteldownloads.iitm.ac.in/downloads_mp4/106101061/lec01.mp4)
(http://npteldownloads.iitm.ac.in/downloads_mp4/106101061/lec39.mp4)

Cryptography and Network Security

(http://npteldownloads.iitm.ac.in/downloads_mp4/106105031/mod01lec01.mp4)
(http://npteldownloads.iitm.ac.in/downloads_mp4/106105031/mod01lec41.mp4)

In NPTEL Phase-I, the files are named as ‘lec’+’lecno’.mp4 and in Phase-II/III, it is named as ‘mod’+’modno’+’lec’+lecno’.mp4

3.  Linux Shell Script for Automatic Downloading of NPTEL Video Lectures

#!/bin/bash
courseid=$(sed -e ‘s/.*\(………\)$/\1/’ course.id)
echo
read -e -p “Enter the Module String (ex. m/mod/Mod/Module)        :  ” -i mod modstring; echo
read -e -p “Enter the Module Number (1 as 01, 9 as 09 and so on)  :  ” -i 01 modno; echo
read -e -p “Enter the Lecture String (ex. L/Lecture/Lec/lec)               :  ” -i lec lecstring; echo
read -e -p “Enter the First Lecture of the Module to Download        :  ” -i 1 lecfirst; echo
read -e -p “Enter the Last Lecture of the Module to Download        :  ” -i 40 leclast; echo

for i in $(seq -f “%02g” $lecfirst $leclast);
do
wget -c http://npteldownloads.iitm.ac.in/downloads_mp4/$courseid/$modstring$modno$lecstring$i.mp4
done

Note:  There are 9 dots (.) in the second line which is used to read, extract and store the nine digit course ID from the ‘course.id’ file to the ‘courseid’ variable.

Now, save the above shell script as ‘nptel-download.sh’ and execute from the shell.

[baskar@baskar ~]$bash nptel-download.sh

You should be able to download all the lectures without going through NPTEL website.

In case, if the course does not have any ‘mod’ string in it, then, remove the ‘mod’ string and ‘modno’ string and keep them empty, and proceed with ‘lecstring’, ‘lecfirst’ and ‘leclast’ as inputs.

4.  For Automatic Downloading of NPTEL Video Lectures in FLV Format

In the script, just change the ‘wget’ line to

wget -c http://npteldownloads.iitm.ac.in/softlinks_flv/$courseid/$modstring$modno$lecstring$i.flv

Hope this tutorial would have saved you from several steps and clicks in downloading your favourite NPTEL Video lectures

Advertisements

One thought on “Download NPTEL Video lectures (MP4 / FLV) without going through NPTEL Website

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s