npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

flux-dl

v1.1.10

Published

Leistungsstarke Video-Downloader Library für YouTube, Vimeo und Dailymotion - komplett in JavaScript, keine externen Binaries

Readme

flux-dl

Eine leistungsstarke Node.js Library zum Downloaden von Videos von YouTube, Vimeo und Dailymotion - komplett in JavaScript, keine externen Binaries!

Installation

npm install flux-dl

Features

✅ YouTube Videos & Audio downloaden (ohne yt-dlp!)
✅ YouTube Suche - Song-Namen eingeben statt URLs!
✅ Vimeo Videos downloaden
✅ Dailymotion Videos downloaden
✅ Automatische Format-Auswahl
✅ Progress-Tracking
✅ Cookie-Support für authentifizierte Videos
✅ Perfekt für Bots (WhatsApp, Discord, Telegram)
✅ Komplett in JavaScript - keine externen Binaries

API Dokumentation

YouTubeSearch

Suche nach Videos ohne URL - perfekt für Bots!

Constructor

const { YouTubeSearch } = require('flux-dl');

const search = new YouTubeSearch();

Methoden

search(query, maxResults)

Sucht nach Videos auf YouTube.

const results = await search.search('Rick Astley Never Gonna Give You Up', 5);

results.forEach(video => {
  console.log(video.title);
  console.log(video.url);
  console.log(video.author);
});

Response:

[
  {
    videoId: "dQw4w9WgXcQ",
    title: "Rick Astley - Never Gonna Give You Up",
    url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    thumbnail: "https://...",
    duration: 213,
    author: "Rick Astley",
    views: "1.7B views",
    publishedTime: "15 years ago"
  }
]
searchAndDownload(query, downloader, options)

Sucht und lädt direkt das erste Ergebnis herunter.

const { VideoDownloader, YouTubeSearch } = require('flux-dl');

const downloader = new VideoDownloader();
const search = new YouTubeSearch();

const result = await search.searchAndDownload(
  'Rick Astley Never Gonna Give You Up',
  downloader,
  { 
    audioOnly: true,
    outputPath: './downloads'
  }
);

console.log(result.filepath);

VideoDownloader

Die Hauptklasse für Video-Downloads.

Constructor

const { VideoDownloader } = require('flux-dl');

const downloader = new VideoDownloader({
  userAgent: 'Mozilla/5.0 ...', // Optional
  timeout: 30000,                // Optional
  encryptionKey: 'your-key'      // Optional
});

Methoden

getVideoInfo(url)

Extrahiert Video-Informationen ohne Download.

const info = await downloader.getVideoInfo('https://youtube.com/watch?v=...');

console.log(info.title);        // Video-Titel
console.log(info.author);       // Autor/Kanal
console.log(info.duration);     // Dauer in Sekunden
console.log(info.quality);      // Qualität (z.B. "1080p")
console.log(info.videoUrl);     // Download-URL
console.log(info.allFormats);   // Alle verfügbaren Formate

Response:

{
  title: "Video Titel",
  videoId: "dQw4w9WgXcQ",
  duration: 213,
  thumbnail: "https://...",
  author: "Kanal Name",
  viewCount: 1742252685,
  videoUrl: "https://...",
  quality: "360p",
  format: { /* Format-Details */ },
  allFormats: [ /* Array aller Formate */ ],
  platform: "YouTube"
}
download(url, outputPath)

Lädt ein Video herunter.

const result = await downloader.download(
  'https://youtube.com/watch?v=...',
  './downloads'  // Optional, default: './downloads'
);

console.log(result.filepath);  // Pfad zur heruntergeladenen Datei
console.log(result.info);      // Video-Informationen

Response:

{
  filepath: "./downloads/video_titel.mp3",
  info: { /* Video-Info Objekt */ }
}
downloadAudio(url, outputPath)

Lädt nur die Audio-Spur herunter.

const result = await downloader.downloadAudio(
  'https://youtube.com/watch?v=...',
  './downloads'
);

console.log(result.filepath);  // Pfad zur Audio-Datei
console.log(result.format);    // Audio-Format Details

Beispiele

YouTube Suche (NEU!)

const { VideoDownloader, YouTubeSearch } = require('flux-dl');

async function searchAndDownload() {
  const downloader = new VideoDownloader();
  const search = new YouTubeSearch();
  
  // Suche nach Song-Name
  const results = await search.search('Rick Astley', 3);
  
  console.log('Gefundene Videos:');
  results.forEach((video, i) => {
    console.log(`${i + 1}. ${video.title} - ${video.author}`);
  });
  
  // Direkt suchen und downloaden
  const result = await search.searchAndDownload(
    'Rick Astley Never Gonna Give You Up',
    downloader,
    { audioOnly: true }
  );
  
  console.log('✓ Downloaded:', result.filepath);
}

searchAndDownload();

Einfacher Download

const { VideoDownloader } = require('flux-dl');

async function downloadVideo() {
  const downloader = new VideoDownloader();
  
  try {
    const result = await downloader.download(
      'https://youtube.com/watch?v=dQw4w9WgXcQ'
    );
    console.log('✓ Video gespeichert:', result.filepath);
  } catch (error) {
    console.error('Fehler:', error.message);
  }
}

downloadVideo();

Video-Info abrufen

const { VideoDownloader } = require('flux-dl');

async function getInfo() {
  const downloader = new VideoDownloader();
  
  const info = await downloader.getVideoInfo(
    'https://youtube.com/watch?v=dQw4w9WgXcQ'
  );
  
  console.log(`Titel: ${info.title}`);
  console.log(`Autor: ${info.author}`);
  console.log(`Dauer: ${info.duration}s`);
  console.log(`Qualität: ${info.quality}`);
  console.log(`Verfügbare Formate: ${info.allFormats.length}`);
}

getInfo();

Nur Audio downloaden

const { VideoDownloader } = require('flux-dl');

async function downloadAudio() {
  const downloader = new VideoDownloader();
  
  const result = await downloader.downloadAudio(
    'https://youtube.com/watch?v=dQw4w9WgXcQ',
    './music'
  );
  
  console.log('✓ Audio gespeichert:', result.filepath);
}

downloadAudio();

Mit Progress-Tracking

const { VideoDownloader } = require('flux-dl');

async function downloadWithProgress() {
  const downloader = new VideoDownloader();
  
  // Info abrufen
  const info = await downloader.getVideoInfo(
    'https://youtube.com/watch?v=dQw4w9WgXcQ'
  );
  
  console.log(`Starte Download: ${info.title}`);
  
  // Download mit Progress
  const result = await downloader.download(info.videoUrl);
  
  console.log('✓ Fertig!');
}

downloadWithProgress();

Mehrere Videos downloaden

const { VideoDownloader } = require('flux-dl');

async function downloadMultiple() {
  const downloader = new VideoDownloader();
  
  const urls = [
    'https://youtube.com/watch?v=...',
    'https://vimeo.com/...',
    'https://dailymotion.com/video/...'
  ];
  
  for (const url of urls) {
    try {
      const result = await downloader.download(url);
      console.log('✓', result.info.title);
    } catch (error) {
      console.error('✗', url, error.message);
    }
  }
}

downloadMultiple();

Für WhatsApp/Discord Bots

const { VideoDownloader, YouTubeSearch } = require('flux-dl');

// WhatsApp Bot Beispiel
bot.on('message', async (msg) => {
  if (msg.body.startsWith('!song ')) {
    const songName = msg.body.replace('!song ', '');
    
    const downloader = new VideoDownloader();
    const search = new YouTubeSearch();
    
    try {
      msg.reply('🔍 Suche...');
      
      const result = await search.searchAndDownload(
        songName,
        downloader,
        { audioOnly: true }
      );
      
      msg.reply('✓ Fertig!');
      await bot.sendFile(msg.from, result.filepath);
    } catch (error) {
      msg.reply('❌ Fehler: ' + error.message);
    }
  }
});

Spezifisches Format wählen

const { VideoDownloader } = require('flux-dl');

async function downloadSpecificFormat() {
  const downloader = new VideoDownloader();
  
  // Alle Formate abrufen
  const info = await downloader.getVideoInfo(
    'https://youtube.com/watch?v=dQw4w9WgXcQ'
  );
  
  // Bestes 1080p Format finden
  const format1080p = info.allFormats.find(f => 
    f.qualityLabel === '1080p' && f.mimeType.includes('video')
  );
  
  if (format1080p) {
    // Direkt mit Format-URL downloaden
    const fs = require('fs');
    const stream = await downloader.spoofing.downloadStream(
      format1080p.url,
      `https://youtube.com/watch?v=${info.videoId}`,
      (percent) => console.log(`Progress: ${percent}%`)
    );
    
    const writer = fs.createWriteStream('./video_1080p.mp4');
    stream.pipe(writer);
    
    await new Promise((resolve, reject) => {
      writer.on('finish', resolve);
      writer.on('error', reject);
    });
  }
}

downloadSpecificFormat();

Unterstützte Plattformen

const { supportedPlatforms } = require('flux-dl');

console.log(supportedPlatforms);
// ['YouTube', 'Vimeo', 'Dailymotion']

Cookie-Support

Für Videos die Authentifizierung benötigen, kannst du eine cookies.txt Datei im Netscape-Format verwenden:

  1. Exportiere Cookies mit Browser-Extension (z.B. "Get cookies.txt")
  2. Speichere als cookies.txt im Projekt-Root
  3. Die Library lädt sie automatisch

Error Handling

const { VideoDownloader } = require('flux-dl');

async function safeDownload(url) {
  const downloader = new VideoDownloader();
  
  try {
    const result = await downloader.download(url);
    return { success: true, filepath: result.filepath };
  } catch (error) {
    if (error.message.includes('403')) {
      return { success: false, error: 'Video nicht verfügbar oder geschützt' };
    } else if (error.message.includes('Platform not supported')) {
      return { success: false, error: 'Plattform nicht unterstützt' };
    } else {
      return { success: false, error: error.message };
    }
  }
}

Technische Details

  • Keine externen Binaries: Komplett in JavaScript implementiert
  • YouTube InnerTube API: Nutzt die offizielle (undokumentierte) API
  • Signatur-Entschlüsselung: Automatische Entschlüsselung von geschützten URLs
  • Browser-Emulation: Simuliert echte Browser-Requests
  • Multi-Platform: Unterstützt YouTube, Vimeo und Dailymotion

Dependencies

  • axios - HTTP-Requests
  • cheerio - HTML-Parsing (für Vimeo/Dailymotion)
  • m3u8-parser - HLS-Stream-Parsing

Lizenz

MIT

Support

Bei Problemen oder Fragen, erstelle ein Issue auf GitHub.