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.
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
This used colab space and if the size of videos are big like more than 110gb(provided by colab) then runtime will crash and no file will be downloaded , it would be better if it download video one by one and then transfer video to drive and clearing the space occupied by it, so that it become possible to download videos of big size(>110gb). it’s possible please add pause/resume functionality.
There is one issue with this. When we download bigger playlist, it is filling the disk space and not moving the files immediately to the Google drive. If this script is modified in such a way that, it copies to Gdrive/shared drive once download completes.