If you have night-time data to use up, and you want to conserve your day-time data then it would be wise to download all your youtube videos at night.
You have 2 options here:
sudo apt-get install -y python3.7-dev
If you installed Python3.8 then sudo apt-get install -y python3.8-dev
cd
inpip3 install -r requirements.txt
python download_all_youtube.py
This script will then look for all the youtube links in our syllabus and download the lot. If a video file is already present it wont download it again.
IMPORTANT by default this script will terminate after 1 hour. If you want to allow your downloads to run while you are sleeping you might want to increase this number. You can set the number of hours from the command line like so:
python download_all_youtube.py --cutoff_after_n_hours=5
The above command will download as much as it can for the next 5 hours.
import youtube_dl
with youtube_dl.YoutubeDL({}) as ydl:
ydl.download(["https://www.youtube.com/watch?v=RleN-6uMF04"])
The url there is any youtube video or playlist url. Nice eh?