Guide to Download youtube Playlist and Complete channel to Drive using Colab and Youtube-dl

Requirements:
This tutorial will guide you to download youtube video, Youtube playlist, or entire youtube channel to your drive or Team Drive.
We will be installing and using Youtube-dl for this task.

Step 1:
Open Google Colab
Step 2:
Mount your drive in Google Colab
Step 3:
Goto insert and select New Code so that we can put our code
Step 4:
Install youtube-dl using the following command

Open this colab script. Paste the youtube, playlist / videos / channel link and select the required settings and download.

It can also download other direct download links.

Supported sites from which it can download the videos are:
https://ytdl-org.github.io/youtube-dl/supportedsites.html

18 Likes

Thanks! Nice share. Is it possible to download with subtitles?

1 Like

How to mount google drive? and there is no new code on the insert tab…

1 Like

run this code to mount drive

from google.colab import drive
drive.mount(’/content/drive’)

1 Like

ValueError Traceback (most recent call last)
in ()
1 from google.colab import drive
----> 2 drive.mount(’/content/drive’)

/usr/local/lib/python3.6/dist-packages/google/colab/drive.py in mount(mountpoint, force_remount, timeout_ms, use_metadata_server)
152 raise ValueError(‘Mountpoint must not be a symlink’)
153 if _os.path.isdir(mountpoint) and _os.listdir(mountpoint):
–> 154 raise ValueError(‘Mountpoint must not already contain files’)
155 if not _os.path.isdir(mountpoint) and _os.path.exists(mountpoint):
156 raise ValueError(‘Mountpoint must either be a directory or not exist’)

ValueError: Mountpoint must not already contain files

1 Like

Haven’t faced such error. so don’t know how to fix. Go to runtime> reset runtime.
And try again.

Updated the thread. Now you don’t have to paste the code or do other things. Just run the script as suggested and download.

thanks man,but there is another way to download it by using 4k video downloader

4k downloader downloads it to your harddrive but it downloads it in your google drive.

I clicked on ad intentionally to support 1Hack team, thank you.

1 Like

Updated the thread. Now you can see which sites are supported from this tool.

1 Like

Thanks :heart_eyes:

Thank you so much