Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/misterhat/mp3monkey
Search, stream and download MP3s from MP3 Monkey.
https://github.com/misterhat/mp3monkey
Last synced: 1 day ago
JSON representation
Search, stream and download MP3s from MP3 Monkey.
- Host: GitHub
- URL: https://github.com/misterhat/mp3monkey
- Owner: misterhat
- License: mit
- Created: 2015-01-16T10:06:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-20T20:06:05.000Z (over 8 years ago)
- Last Synced: 2024-10-28T12:51:06.204Z (10 days ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mp3monkey
Search, stream and download MP3s from MP3 Monkey.## Installation
$ npm install mp3monkey
## Example
```javascript
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:
```javascript
{
host: 'https://mp3monkey.net',
needle: {} // options passed into needle requests
}
````done` returns an array of the following objects:
```javascript
{
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