Search code examples
python-3.6youtube-dl

Python 3.6 - How to use the external downloader in Youtube-dl


Im using python 3.6 with the youtube_dl module on Ubuntu 18.04.

Im trying to download Youtube videos with aria2c.

These are my option settings:

import youtube_dl

opts = {
'format': "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best",
'external-downloader' : 'aria2c',
'external-downloader-args' : "--max-connection-per-server=16 --dir=/home/downloads",
}
ydl=youtube_dl.YoutubeDL(opts)
ydl.download([f"https://www.youtube.com/watch?v={ytId}"])

But it still uses the built-in downloader.


Solution

  • opts = {
    'format': "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best",
    'external_downloader' : 'aria2c',
    'external_downloader_args' :['--max-connection-per-server=16','--dir=/home/downloads'],
    }