! pip install youtube-dl
!apt-get install aria2 -y
! youtube-dl -o "/content/drive/MyDrive/%(title)s.%(ext)s" -f best {url} --external-downloader aria2c --external-downloader-args "-x 16 -k 1M"
===================================================================================================================================================
!yt-dlp -o "/content/drive/MyDrive/%(title)s.%(ext)s" -f b {url} --external-downloader aria2c --external-downloader-args "-x 16 -k 1M"
or DL high quality
##the latest revision with multithreading
===================================================================================================================================================
import os
import concurrent.futures
from google.colab import drive
drive.mount('/content/drive', force_remount=False)
!apt-get install aria2 -y
!sudo wget -qO /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp
!sudo chmod a+rx /usr/local/bin/yt-dlp
!yt-dlp --version
#!sudo yt-dlp -U
!sudo apt install ffmpeg
!ffmpeg -version
# Define multiple URL arrays
url_list = [
"https://www.youtube.com/watch?v=3xj9kClATA0","https://www.youtube.com/watch?v=7iIZFtS6ghY","https://www.youtube.com/watch?v=8Wz0gHODr4Y","https://www.youtube.com/watch?v=NxA6kqB1Mok","https://www.youtube.com/watch?v=Px6Xl-YSqzs","https://www.youtube.com/watch?v=6Gos3Ix7ty4","https://www.youtube.com/watch?v=9NdLFTWodDY","https://www.youtube.com/watch?v=fmPid5ozkqQ","https://www.youtube.com/watch?v=EQLgu8GcjZI","https://www.youtube.com/watch?v=H6Uz8uTU89Q","https://www.youtube.com/watch?v=LdGWB4sHppQ","https://www.youtube.com/watch?v=OB7XxNc4e_4"
]
# Function to execute the command for each URL
def download_video(url):
!yt-dlp -o "/content/drive/MyDrive/%(title)s.%(ext)s" -f b {url} --external-downloader aria2c --external-downloader-args "-x 3 -k 1M"
# Execute the code using multiple threads
with concurrent.futures.ThreadPoolExecutor() as executor:
executor.map(download_video, url_list)