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 🙏

© 2024 – Pkg Stats / Ryan Hefner

video-extractor

v3.0.6

Published

Video Extractor supports youtube-dl stream download for @discordjs/voice Audio Resource , for other Strean packages or functions as it will return a stream and its type

Downloads

89

Readme

About

Video Extractor is a Extractor/Scrapper/Downloader and Helps Players to fetch data from custom-youtube-dl or Custom Extractors , as Per reduces extra work and credentials.

  • Supports Proxy , Cookies Headers for YT Playlists and Cookies.txt File for youtube-dl as ExtractorOptions
  • Even Supports Youtube Live Streams to Stream on your Web Application(discord bots , html player and e.t.c)
  • Object-oriented , means Value returned in a structure format
  • Python Based Browser Extrator -> Need to have Python installed in binary $PATH
  • Supports 700+ Website's Urls and Even Youtube Search
  • Delay/Buffer Timeout is max 3 seconds on tracks and 7 sec for Playlists
  • Customisable Extractors
  • Performant
  • 100% coverage of youtube-dl and custom extractors

Installation

Node.js 16 or newer is required.

npm install video-extractor@latest

Example usage

Extractor Video/Playlist/Album Data from any Platform :-

const { quickExtract , videoExtractor } = require('video-extractor') //For CommonJS
                            //OR
import { quickExtract , videoExtractor } from 'video-extractor' //for ES6/TypeScript


var Data = await quickExtract.softExtractor(Url || 'Despacito'})
var StreamData = await quickExtract.streamExtractor(Url || 'Despacito')

Structure of Data/Track

Data : {
  album : Album | Boolean,
  tracks : [
  Track {
    trackId: 1,
    url: 'https://vimeo.com/246660563',
    videoId: '246660563',
    title: 'Fly - imai ft. 79, Kaho Nakamura',
    description: "Stop-motioned various kinds of mochi at my grandparents' place.\n" +
      'Direction/animation: Baku Hashimoto\n' +
      'Logo design: 79\n' +
      'Track by imai (group_inou) featuring 79, Kaho Nakamura (中村佳穂)\n' +
      'soundcloud.com/imai/psep\n' +
      'Behind the scene: baku89.com/making-of/fly',
    author: { Id: undefined, name: 'Baku 麦', url: 'https://vimeo.com/baku89' },
    extractorModel: { orignal: 'vimeo', custom: 'youtube-dl' },
    duration: { ms: 194000, readable: '3 Minutes 14 Seconds' },
    thumbnail: {
      Id: '246660563',
      metadata: 'https://i.vimeocdn.com/filter/overlay?src0=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F696079667-94a0641db16295fc9c32803c15331b4dea14ded3dcdcad3101a8b278c6c04bf1-d_1280x720&src1=https%3A%2F%2Ff.vimeocdn.com%2Fimages_v6%2Fshare%2Fplay_icon_overlay.png'
    },
    channel: { name: 'Baku 麦', Id: 'Baku 麦', url: 'https://vimeo.com/baku89' },
    views: 60812,
    fps: 15,
    keywords: undefined,
    comments: undefined,
    subtitles: { en: [Array] },
    isLive: false,
    ratings: { likes: 2332, dislikes: 0 },
    videoMetadata: {
      video: [Object],
      audio: 'https://150vod-adaptive.akamaized.net/exp=1651128988~acl=%2F1cf9dbe0-76c9-4d13-9252-3a71c1c0cbc5%2F%2A~hmac=33df1c437a48fe5a78f855ca694e16721fee7ef31b594bd38cbaa5caa3f61238/1cf9dbe0-76c9-4d13-9252-3a71c1c0cbc5/sep/audio/0173d7d2/playlist.m3u8'
    },
    stream: {
      preview: undefined,
      url: 'https://150vod-adaptive.akamaized.net/exp=1651128988~acl=%2F1cf9dbe0-76c9-4d13-9252-3a71c1c0cbc5%2F%2A~hmac=33df1c437a48fe5a78f855ca694e16721fee7ef31b594bd38cbaa5caa3f61238/1cf9dbe0-76c9-4d13-9252-3a71c1c0cbc5/sep/audio/0173d7d2/playlist.m3u8',
      buffer: [Socket],
      type: undefined,
      videoId: '246660563',
      duration: [Object]
    }
  }
],
  error: String | Error |  Error[]  | undefined
}
  • Cookies.txt File can be exported from "Cookies.txt" extension on chrome and netscape cookies file type is needed and only path to taht file is neeed for youtube-dl and for YT Cookies for YT Playlist , just give Cookies headers
  • Extractor() is same as StreamDownloader() but it will not download info related to Streams like - "stream","stream_type" and e.t.c , just the info about the Query
  • Data.tracks[0].stream can be used in terms of stream value in @discordjs/voice or any other Audio package .
  • Object can be seen undefined or undefined based on platform , like channelId and channel_url isn't present for facebook and soundcloud , But most usable stuff will be there for all shorts of Videos
  • Video-Extractor Supports Live Streams of Youtubes and you can stream for your discord.js/voice Audio Resource stream value

Cookies.txt Info for youtube-dl

   How do I pass cookies to youtube-dl?
       for example  /path/to/cookies/file.txt.  Note that  the
       cookies  file  must  be  in Mozilla/Netscape format and the first line of the cookies file
       must be either # HTTP Cookie File or  # Netscape HTTP Cookie File.   Make  sure  you  have
       correct  newline  format  (<https://en.wikipedia.org/wiki/Newline>)  in the cookies file and
       convert newlines if necessary to correspond with your OS, namely CRLF (\r\n) for  Windows,
       LF  (\n)  for  Linux  and  CR  (\r)  for  Mac  OS.  HTTP Error 400: Bad Request when using
       Cookies Options is a good sign of invalid newline format.

       Passing cookies to youtube-dl is  a  good  way  to  workaround  login  when  a  particular
       extractor  does  not  implement it explicitly.

Links

Contributing

Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the ReadMe.md

Help

If you don't understand something in the ReadMe.md , you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official Support Server.