Puesto al día el 11 de noviembre de 2025.
yt-dlp is a feature-rich command-line audio/video downloader with support for thousands of sites. The project is a fork of youtube-dl based on the now inactive youtube-dlc.
«README» en yt-dlp
instalación
vale con descargar la última versión del archivo binario dentro de la carpeta bin local y darle permiso de ejecución:
wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O ~/bin/yt-dlp2024-05-01 19:24:38 (2,20 MB/s) - “/home/ernesto/bin/yt-dlp” guardado [2916945/2916945]
chmod 770 ~/bin/yt-dlp
actualización
yt-dlp -ULatest version: stable@2024.04.09 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.04.09 from yt-dlp/yt-dlp)
cantata + yt-dlp
con yt-dlp, se puede obtener una URL de flujo para cantata (u otros):
yt-dlp -g QuXwg1Ce_jg
esto devuelve (al menos) un par de enlaces. luego, sobre la lista de reproducción de cantata, se despliega el menú contextual (botón derecho del ratón) y se copia el enlace como URL de flujo:
cantata > lista de reproducción > botón derecho > Añadir URL de flujo

en lugar de copiar únicamente el identificador de video de youtube, también se le puede pasar la URL entera al comando:
yt-dlp -g https://www.youtube.com/watch?v=QuXwg1Ce_jg
bash
nano ~/bin/youtubeecho 'URL de YOUTUBE:'
read url
yt-dlp -g $url
paplay /usr/share/sounds/ubuntu/stereo/system-ready.ogg
chmod 770 ~/bin/youtube
extracción de audio
yt-dlp --help-x, --extract-audio Convert video files to audio-only files (requires ffmpeg and ffprobe)
«Post-Processing Options» en yt-dlp
--audio-format FORMAT Format to convert the audio to when -x is used. (currently supported: best (default), aac, alac, flac, m4a, mp3, opus, vorbis, wav). You can specify multiple rules using similar syntax as --remux-video
--audio-quality QUALITY Specify ffmpeg audio quality to use when converting the audio with -x. Insert a value between 0 (best) and 10 (worst) for VBR or a specific bitrate like 128K (default 5)
yt-dlp QuXwg1Ce_jg -x --audio-format mp3 --audio-quality 192[youtube] Extracting URL: QuXwg1Ce_jg
[...]
[download] Destination: Vía Lilo [QuXwg1Ce_jg].webm
[download] 100% of 790.36KiB in 00:00:00 at 1.14MiB/s
[ExtractAudio] Destination: Vía Lilo [QuXwg1Ce_jg].mp3
Deleting original file Vía Lilo [QuXwg1Ce_jg].webm (pass -k to keep)
bash
nano ~/bin/youtubeecho 'URL de YOUTUBE:'
read url
yt-dlp $url -x --audio-format mp3 --audio-quality 192
paplay /usr/share/sounds/ubuntu/stereo/system-ready.ogg
chmod 770 ~/bin/youtube
problemario
unsupported version of python
yt-dlp -UImportError: You are using an unsupported version of Python. Only Python versions 3.9 and above are supported by yt-dlp
sudo apt install python3.9
python3 --versionPython 3.8.10
python3.9 yt-dlp -Uyt-dlp is up to date (stable@2025.05.22 from yt-dlp/yt-dlp)
alias yt="python3.9 ~/bin/yt-dlp"
yt -Uyt-dlp is up to date (stable@2025.05.22 from yt-dlp/yt-dlp)
alias permanente en bash
Aliases in Bash allow you to create shortcuts for long or frequently used commands. This makes it easier to execute complex commands with a simple keyword.
«Bash alias» en W3Schools.
nano ~/.bashrcalias yt="python3.9 ~/bin/yt-dlp"
source ~/.bashrc
yt -UUpdated yt-dlp to stable@2025.06.09 from yt-dlp/yt-dlp
ERROR: unable to download video data HTTP Error 403: Forbidden
a 11 de noviembre de 2025, sólo topo con este error cuando trato de extraer el audio del video mediante el parámetro -x:
yt-dlp jxnB5cmMYcM -x --audio-format mp3 --audio-quality 192ERROR: unable to download video data: HTTP Error 403: Forbidden
open() No existe el archivo o el directorio
el comando yt-dlp funciona correctamente sin dicho parámetro, así que me valgo de ffmpeg para extraer el audio a continuación:
ffmpeg -i "archivo de video.mp4" -q:a 0 "archivo de audio.mp3"[...]
Output #0, mp3, to 'archivo de audio.mp3':
Metadata:
TSSE : Lavf58.29.100
Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, fltp
Metadata:
encoder : Lavc58.54.100 libmp3lame
size= 7635kB time=00:06:07.98 bitrate= 170.0kbits/s speed=30.5x
video:0kB audio:7635kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.003236%
fuentes
- Jeff Shillitto, «How to extract audio from video with FFmpeg» en Shotstack, 2023.
- «yt-dlp» en yt-dlp.