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

playdl-music-extractor

v3.0.13

Published

PlayDL Music Extractor is a Extractor/Scrapper and Helps Players to fetch data from play-dl or Custom Extractors , as Per reduces extra work and credentials

Downloads

106

Readme

About

PlayDL Music Extractor is a Extractor/Scrapper and Helps Players to fetch data from play-dl or Custom Extractors , as Per reduces extra work and credentials.

  • Auto - UserAgents Method for Ratelimit Issue ( Fixed Youtube [ 429 ] Error )
  • Supports User-Agents and Youtube Cookies for Stream and Extractor Method
  • Object-oriented , means Value returned in a structure format or Class
  • Supports Youtube , Spotify , Reverbnation , SoundCloud , Facebook 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 play-dl and custom extractors

Installation

Node.js 16 or newer is required.

npm install playdl-music-extractor

Example : Fetched Data with Stream and Lyrics

  Track {
    trackId: 1,
    url: 'https://www.youtube.com/watch?v=kJQP7kiw5Fk',
    videoId: 'kJQP7kiw5Fk',
    title: 'Luis Fonsi - Despacito ft. Daddy Yankee',
    description: '“Despacito” disponible ya en todas las plataformas digitales: https://UMLE.lnk.to/DOoUzFp \n' +
      '“Imposible” disponible ya en todas las plataformas digitales: https://UMLE.lnk.to/IMPOSIBLEFp\n' +
      '“Calypso” disponible ya en todas las plataformas digitales: https://UMLE.lnk.to/CLYPSFp\n' +
      'Echame La Culpa disponible ya en todas las plataformas digitales: https://UMLE.lnk.to/ELCFp\n' +
      '\n' +
      '\n' +
      'Best of Luis Fonsi / Lo mejor Luis Fonsi: https://goo.gl/KLWPSa \n' +
      'Subscribe here: https://goo.gl/nkhcGc\n' +
      'Sigue a Luis Fonsi: \n' +
      'Official Site: http://www.luisfonsi.com/ \n' +
      'Facebook: https://www.facebook.com/luisfonsi/ \n' +
      'Twitter: https://twitter.com/LuisFonsi \n' +
      'Instagram: https://www.instagram.com/luisfonsi\n' +
      '\n' +
      '#LuisFonsi #Despacito #Imposible #Calypso #EchamelaCulpa #NadaEsImposible #NothingisImpossible #LF\n' +
      '\n' +
      '\n' +
      'Music video by Luis Fonsi performing Despacito. (C) 2017 Universal Music Latino',
    author: {
      name: 'LuisFonsiVEVO',
      url: 'https://www.youtube.com/channel/UCLp8RBhQHu9wSsq62j_Md6A'
    },
    extractorModel: { orignal: 'youtube', custom: 'play-dl' },
    duration: { ms: 282000, readable: '4 Minutes 42 Seconds' },
    thumbnail: {
      Id: 'kJQP7kiw5Fk',
      url: 'https://i.ytimg.com/vi/kJQP7kiw5Fk/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLCuffhiAPaneh-5dnyfyvY_mDwxhQ'
    },
    channel: {
      name: 'LuisFonsiVEVO',
      Id: 'UCLp8RBhQHu9wSsq62j_Md6A',
      url: 'https://www.youtube.com/channel/UCLp8RBhQHu9wSsq62j_Md6A'
    },
    isLive: false,
    ratings: { likes: 47759879, dislikes: 0 },
    stream: {
      buffer: [Readable],
      videoUrl: 'https://www.youtube.com/watch?v=kJQP7kiw5Fk',
      type: 'webm/opus',
      duration: [Object],
      videoId: 'kJQP7kiw5Fk'
    },
    lyrics: 'Come and move that in my direction\n' +
      "So thankful for that, it's such a blessin', yeah\n" +
      'Turn every situation into heaven, yeah\n' +
      'Oh-oh, you are\n' +
      'My sunrise on the darkest day\n' +
      "Got me feelin' some kind of way\n" +
      'Make me wanna savor every moment slowly\n' +
      'You fit me tailor-made, love how you put it on\n' +
      'Got the only key, know how to turn it on\n' +
      'The way you nibble on my ear, the only words I wanna hear\n' +
      'Baby, take it slow so we can last long\n' +
      '\n' +
      'Tú, tú eres el imán y yo soy el metal\n' +
      'Me voy acercando y voy armando el plan\n' +
      'Sólo con pensarlo se acelera el pulso\n' +
      'Ya, ya me está gustando más de lo normal\n' +
      'Todos mis sentidos van pidiendo más\n' +
      'Esto hay que tomarlo sin ningún apuro\n' +
      '\n' +
      'Despacito\n' +
      'Quiero respirar tu cuello despacito\n' +
      'Deja que te diga cosas al oído\n' +
      'Para que te acuerdes si no estás conmigo\n' +
      '\n' +
      'Despacito\n' +
      'Quiero desnudarte a besos despacito\n' +
      'Firmo en las paredes de tu laberinto\n' +
      'Y hacer de tu cuerpo todo un manuscrito\n' +
      '\n' +
      'Quiero ver bailar tu pelo, quiero ser tu ritmo\n' +
      'Que le enseñes a mi boca\n' +
      'Tus lugares favoritos\n' +
      'Déjame sobrepasar tus zonas de peligro\n' +
      'Hasta provocar tus gritos\n' +
      'Y que olvides tu apellido\n' +
      'Pasito a pasito, suave suavecito\n' +
      'Nos vamos pegando, poquito a poquito\n' +
      'Cuando tú me besas con esa destreza\n' +
      'Veo que eres malicia con delicadeza\n' +
      'Pasito a pasito, suave suavecito\n' +
      'Nos vamos pegando, poquito a poquito\n' +
      'Y es que esa belleza es un rompecabezas\n' +
      "Pero pa' montarlo aquí tengo la pieza\n" +
      '\n' +
      'Despacito\n' +
      'Quiero respirar tu cuello despacito\n' +
      'Deja que te diga cosas al oído\n' +
      'Para que te acuerdes si no estás conmigo\n' +
      '\n' +
      'Despacito\n' +
      'Quiero desnudarte a besos despacito\n' +
      'Firmo en las paredes de tu laberinto\n' +
      'Y hacer de tu cuerpo todo un manuscrito\n' +
      '\n' +
      'Pasito a pasito, suave suavecito\n' +
      'Nos vamos pegando, poquito a poquito\n' +
      'Que le enseñes a mi boca\n' +
      'Tus lugares favoritos\n' +
      'Pasito a pasito, suave suavecito\n' +
      'Nos vamos pegando, poquito a poquito\n' +
      'Hasta provocar tus gritos\n' +
      'Y que olvides tu apellido\n' +
      'Despacito'
  },

Tips/Base Information :

  • Track Data is instance of Track Class and you can also retrieve Stream Data or Lyrics by getStream(...args) and getLyrics()
  • Stream will be Processed through Official "play-dl" Npm Package
  • Besides Official Use of play-dl Package , You can retrieve data from facebook,deezer,reverbnation and vimeo (soon)

Methods :

  • new playdl.streamExtractor() OR playdlQuick.streamExtractor()
  • new playdl.softExtractor() OR playdlQuick.softExtractor()
  • new playdl.exec() OR playdlQuick.exec()
Option's Scheme :
declare type secretTokens = {
  spotify?: {
    client_id?: string | number;
    client_secret?: string | number;
    refresh_token?: string | number;
    market?: string | "US";
  };
  soundcloud?: { client_id?: string | number };
};

declare type fetchOptions = {
  tokens?: secretTokens;
  fetchLimit?: number;
  streamQuality?: string;
  rawCookies?: string;
  userAgents?: string[];
  skipAlbumLimit?: Boolean;
};

export type scrapperOptions = {
  fetchLyrics?: boolean | true;
  eventReturn?: { metadata?: any };
  ratelimit?: number;
  ignoreInternalError?: boolean | true;
  fetchOptions?: fetchOptions;
  streamDownload?: boolean | false;
  playersCompatibility?: boolean | false;
  waitForPromise?: Boolean | true;
};

Code Examples :

Code Snippet :

const { playdl } = require("playdl-music-extractor");

const quickHandler = new playdl();

quickHandler.on("track", (...eventData) => console.log(eventData));

new Promise(async (resolve, reject) => {
  resolve(
    quickHandler.softExtractor("Despacito", {
      fetchOptions: { fetchLimit: 1 },
    })
  );
  resolve(
    quickHandler.streamExtractor(
      "https://open.spotify.com/track/1SOClUWhOi8vHZYMz3GluK?si=3c010c9df65a4552",
      {
        fetchOptions: { fetchLimit: 1 },
      },
      "tracks"
    )
  );
  resolve(
    quickHandler.exec("Despacito", {
      fetchOptions: { fetchLimit: 1 },
    })
  );
});

Some Minor Usages :

Raw Cookies option :
playdl.exec("Despacito", {
  fetchOptions: {
    rawCookies:
      "xxx-youtubeCookies-from-network-inspect-of-youtubeHomePage-xxx",
  },
});
User Agents option :
playdl.exec("Despacito", {
  fetchOptions: {
    userAgents: [
      "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion",
    ],
  },
});

Supportable Websites Links :

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.