https://github.com/sinclairnick/magnetic-music
searches and formats music torrents into albums
https://github.com/sinclairnick/magnetic-music
metadata music torrent
Last synced: 11 months ago
JSON representation
searches and formats music torrents into albums
- Host: GitHub
- URL: https://github.com/sinclairnick/magnetic-music
- Owner: sinclairnick
- License: mit
- Created: 2018-07-23T07:30:44.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-02T21:20:14.000Z (over 7 years ago)
- Last Synced: 2025-07-14T11:52:08.830Z (12 months ago)
- Topics: metadata, music, torrent
- Language: JavaScript
- Homepage:
- Size: 81.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# magnetic-music
searches for and formats music torrents into Album objects
## Installation
```javascript
npm i --save magnetic-music
```
## Usage
```javascript
import magMusic from 'magnetic-music';
//or
const magMusic = require('magnetic-music').default;
const albums = [];
magMusic('frank ocean', { array: albums })
```
It is recommended to provide your own array which will receive Albums individually, as their metadata is retrieved.
Alternatively, you can wait for the promise to be resolved either when all formatting is done, or a 15 second timeout is complete:
```javascript
let albums;
magMusic('frank ocean').then( res => albums = res)
```
The latter method is generally slower because of the nature of torrents.
## Output
Both methods will result in arrays of Album objects:
```javascript
Album {
linkName: String,
link: 'magnet:?xt=urn:...',
health: X,
songs: Song[],
covers: Buffer[],
size: 'XXX.XX MB',
metadata: Boolean
}
```
With arrays of Song objects:
```javascript
Song {
fileName: String,
torrentIndex: Number,
format: String,
link: 'magnet:?xt=urn:...',
length: Number,
file: any
}
```
### License
magnetic-music is [MIT licensed](./LICENSE).