DEV Community

Praneeth Kumar Reddy Ballarapu
Praneeth Kumar Reddy Ballarapu

Posted on

Command Line Interface to download NPTEL course videos by course id

GitHub release
GitHub stars
GitHub forks
GitHub issues
GitHub license

nptel-dl

A cross-platform python based utility to download course videos from NPTEL.

By Praneeth Kumar Reddy Ballarapu (praneeth14)

intro.png

Before creating an issue, please do the following:

  1. Use the GitHub issue search — check if the issue is already reported.
  2. Check if the issue is already fixed — try to reproduce it using the latest master in the repository.
  3. Please make pull requests to contribute to the repository

Features

  • Downloads entire course videos in a well organised directory strcuture
  • Resume capability for a course video. <!-- - Save course youtube video ids to a json file (option: --save). -->

Requirements

  • Python 3.x
  • Python pip
  • Python module requests
  • Python module bs4
  • Python module lxml
  • Python module youtube_dl
  • Python module colorama
  • Python module argparse
  • Python module termcolor

Module Installation

pip install -r requirements.txt

Download nptel-dl

You can download the latest version of nptel-dl by cloning the GitHub repository.

git clone https://github.com/praneeth14/nptel-dl.git

Usage

Download a course

python nptel-dl.py --c=COURSE_ID

Download course videos with specific resolution

python nptel-dl.py --c=COURSE_ID --q=VIDEO_QUALITY_CODE




Steps to download course videos

  1. Make sure that you already installed python 3.x on your machine otherwise download from here Python 3.x
  2. Now clone or download this repository.
  3. Open command prompt and goto the repository downloaded path
  4. Run pip install -r requirements.txt to install required modules
  5. Copy the course id you want to download from NPTEL website. For example https://nptel.ac.in/courses/106105217/ here course id is 106105217
  6. Now run python nptel-dl.py --c=106105217 --q=18
  7. Default quality code is 18

Format codes

Format Code Extension Resolution Note
140 (worst) m4a audio only DASH audio , audio@128k
160 mp4 144p DASH video, video only
133 mp4 240p DASH video, video only
134 mp4 360p DASH video, video only
135 mp4 480p DASH video, video only
136 mp4 720p DASH video, video only
17 3gp 176x144
36 3gp 320x240
5 flv 400x240
43 webm 640x360
18 mp4 640x360
22 mp4 1280x720 (best quality)

Note: The above codes may differ based on videos

Advanced Usage


Author: Praneeth Kumar Reddy Ballarapu (praneeth14)

usage: nptel-dl.py [-h] --c C [--q Q]

Nptel Course Downloader

optional arguments:
  -h, --help  show this help message and exit
  --c C       Course ID to download the course
  --q Q       Video quality code (default code '18')

A cross-platform python based utility to download course videos from nptel.

positional arguments:
  --c           NPTEL Course ID.
  --q           Video Quality Code

General:
  -h, --help        Shows the help.
  -v, --version     Shows the version.


Others:
  --save            Saves all youtube video ids to a JSON file
  
Example:
  python nptel-dl.py --c=106106169 --q=18
  python nptel-dl.py --c=106106169

Repo Link: https://github.com/praneeth14/nptel-dl

Top comments (0)