How to Download YouTube Videos using Python

Every once in a while I see a YouTube video that I fear is significant enough that it may be censored or deleted at a future date.

Such is the case with my recent post about Jeffrey Sach’s interview with Bloomberg :

Interview Bloomberg “Surveillance” : Jeffery Sachs:  10/03/202

Interview Starts @ 1:51:21  | Read original blog post.

 

INSTRUCTIONS:

1) IF NO TECHNICAL SKILLS:

  • If you don’t have the technical skills, YouTube’s Premium subscription gives you access to do this.

 

2) IF SOME PYTHON TECH SKILLS:

  • But if you have a little programming savvy, you can use a program that I’ve used to do my CiteIt transcripts.
  • In this example we are assuming you have Python and pip installed. (pip is included in Python 3.4+)

YOUTUBE-DL Homepage:

 

INSTALL youtube-dl

  • pip install git+https://github.com/ytdl-org/youtube-dl.git@master#egg=youtube_dl

 

DOWNLOAD SCRIPT

 

RUN SCRIPT:

  • python3 download-youtube.py

 

PYTHON SCRIPT CONTENTS:

from __future__ import unicode_literals
import youtube_dl

ydl_opts = {}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download(['https://youtu.be/nbt-CsSRJl8'])