cc
mkdir youtube-downloader
cd youtube-downloader
npm init -y
npm install express yt-dlp
const express = require('express');
const { exec } = require('child_process');
const app = express();
const port = 3000;
// Middleware
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.post('/download', (req, res) => {
const videoUrl = req.body.url;
exec(`yt-dlp ${videoUrl}`, (error, stdout, stderr) => {
if (error) {
return res.status(500).send(`Fehler beim Download: ${stderr}`);
}
res.send('Download abgeschlossen: ' + stdout);
});
});
app.listen(port, () => {
console.log(`Server läuft auf http://localhost:${port}`);
});
YouTube Video Downloader
YouTube Video Downloader
Gib die URL des YouTube-Videos ein, das du herunterladen möchtest:
Kommentare
Kommentar veröffentlichen