Forum Discussion
¿Cómo puedo descargar mp3 de YouTube?
Descargador de YouTube a MP3 en una computadora con Windows mediante scripts de PowerShell es totalmente posible y puede ser una forma eficiente de automatizar el proceso. Por lo general, esto implica el uso de herramientas de línea de comandos.
1. Cree un script de PowerShell para descargar archivos MP3.
Ejemplo de script de PowerShell:
Path to yt--d1p executable
$ytDlpPath = "C:\Tools\yt--d1p\yt--d1p.exe"# URL of the YouTube video
$videoUrl = "https://www.youtube,com/watch?v=YOUR_VIDEO_ID"# Output directory
$outputDir = "C:\Users\YourName\Music\YouTubeDownloads"# Create output directory if it doesn't exist
if (!(Test-Path -Path $outputDir)) {
New-Item -ItemType Directory -Path $outputDir
}# Download and convert to MP3
$arguments = @(
"-x", # Extract audio
"--audio-format", "mp3", # Convert to MP3
"-o", "$outputDir\%(title)s.%(ext)s", # Output filename pattern
$videoUrl
)# Run yt--d1p with arguments
Start-Process -FilePath $ytDlpPath -ArgumentList $arguments -NoNewWindow -Wait
Cómo usarlo:
- Guarda este script como DownloadYouTubeMP3.ps1.
- Modifica las variables $videoUrl, $ytDlpPath y $outputDir según corresponda.
- Ejecuta el script en PowerShell.
2. Descargador de YouTube a MP3. Ejecute el script de PowerShell
Abra PowerShell como administrador.
Ejecute el script:
& "C:\Path\To\DownloadYouTubeMP3.ps1"
Ventajas de este enfoque:
- Completamente automatizable.
- Personalizable para múltiples descargas.
- No requiere herramientas con interfaz gráfica de usuario.