Socket
Book a DemoInstallSign in
Socket

pablo-music

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pablo-music

A simple module to search and download music from YouTube.

1.0.0
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

Pablo Music

A simple Node.js module to search and download music from YouTube. With pablo-music, you can easily play and retrieve music tracks using a search query.

Features

  • Search for music on YouTube.
  • Download audio in MP3 format.
  • Simple and easy-to-use API.

Installation

You can install the pablo-music module via npm:

npm install pablo-music

Usage

To use the pablo-music module, require it in your Node.js application and call the playMusic function with a search query.

Example

const { playMusic } = require('pablo-music');

(async () => {
  const musicInfo = await playMusic('Your Favorite Song');
  if (musicInfo) {
    console.log('Music Info:', musicInfo);
  } else {
    console.log('Music not found or failed to download.');
  }
})();

Parameters

  • query (string): The search query for the music you want to find.

Returns

The playMusic function returns a Promise that resolves to an object containing:

  • title (string): The title of the music.
  • duration (string): The duration of the music.
  • mp3 (string): The direct URL to download the music in MP3 format.
  • thumbnail (string): The URL of the music thumbnail.
  • views (string): The number of views for the video.
  • uploaded (string): The time since the video was uploaded.

Error Handling

If the function fails to find any results or download the music, it will log the error to the console and return null.

Contributing

Contributions are welcome! If you would like to contribute to this project, please fork the repository and submit a pull request.

License

This project is licensed under the ISC License. See the LICENSE file for details.

Acknowledgments

  • yt-search - For searching YouTube videos.
  • Axios - For making HTTP requests.

Keywords

music

FAQs

Package last updated on 25 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.