Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/misterhat/allmuz
Search, stream and download MP3s from Allmuz.
https://github.com/misterhat/allmuz
Last synced: 1 day ago
JSON representation
Search, stream and download MP3s from Allmuz.
- Host: GitHub
- URL: https://github.com/misterhat/allmuz
- Owner: misterhat
- Created: 2014-12-03T11:49:58.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-13T12:24:36.000Z (almost 10 years ago)
- Last Synced: 2024-10-11T19:49:37.367Z (27 days ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# allmuz
Search, stream and download MP3s from Allmuz.## Installation
$ npm install allmuz
## Example
```javascript
var fs = require('fs'),
allmuz = require('./');allmuz('ty segall it #1', function (err, tracks) {
var track;if (err || !tracks || !tracks.length) {
return console.error('nothing found');
}track = tracks[0];
track.song.pipe(fs.createWriteStream('out.mp3'));console.log(
'found "' + track.title + '" by "' + track.artist + '", ' +
track.duration + ' seconds long'
);
console.log('listen @ ' + track.direct);
console.log('downloading to "out.mp3"...');
});
```## API
### allmuz(terms, [options], done)
Search MP3 tracks based on search terms.`terms` is expected to be search terms for MP3 tracks. For example, an artist
and track name.`options` is an optional object which is passed to each *needle* instance's
`options` argument. You can specify custom timeouts or agents this way.`done` returns a list of tracks. Each track may contain a `title`, `artist`,
`duration`, `direct` and `song` field. `direct` is the URL to the MP3 file and
`song` is a lazystream that will directly output the MP3 stream when read.## License
MIT