New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mp3monkey

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mp3monkey

Search, stream and download MP3s from MP3 Monkey.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

mp3monkey

Search, stream and download MP3s from MP3 Monkey.

Installation

$ npm install mp3monkey

Example

var fs = require('fs'),
    mp3monkey = require('mp3monkey');

mp3monkey('ty segall bag i\'m in', function (err, tracks) {
    if (!err && tracks.length) {
        tracks[0].song.pipe(fs.createWriteStream('./bag.mp3'));
    }
});

API

mp3monkey(terms, [options], done)

Search the MP3 Monkey website and return a list of tracks.

terms is expected to be a string of search terms.

options is an optional object with the following properties:

{
    host: 'https://mp3monkey.net',
    needle: {} // options passed into needle requests
}

done returns an array of the following objects:

{
    artist: String,
    direct: String, // a url of the mp3 track
    duration: Number,
    song: ReadableStream, // a lazy readable stream of the mp3 file
    title: String
}

Note that the direct link will not work unless you set the referer header. In order to stream MP3s from MP3 Monkey, you must set the 'Referer' header to the host of the website. Using the song stream handles this automatically.

License

MIT

Keywords

mp3monkey

FAQs

Package last updated on 20 Apr 2016

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