metator
v0.0.4
Published
Getting information about video files from a torrent and local files.
Downloads
4
Maintainers
Readme
What is metator
?
Getting information about video files from a torrent and local files.
Installation
npm i metator
Usage
Import the library in your code:
const metator = require('metator');
This is video/torrent?
- From video
metator.isvi('./bunny.m4v').then(res => {
console.log(res); //=> true
});
- From torrent
metator.isto('3652DB1AFBC5D414DBCAF5920F741FF93B1ED9E5').then(res => {
console.log(res); //=> true
});
- From video/torrent
metator.isvt('6B!@#$%^5B').then(res => {
console.log(res); //=> false
});
Get info from video/torrent
- From video
metator.info('./bunny.m4v').then(res => {
console.log(res);
// [ { path: './bunny.m4v',
// size: 3889885,
// file: 'bunny.m4v',
// sha1: '2951247a448b6123494a039623bde6b9f79603ed' } ]
});
- From torrent
metator.info('https://archive.org/download/Colgate-Comedy-Hour-S6E1/Colgate-Comedy-Hour-S6E1_archive.torrent').then(res => {
console.log(res);
//[ { size: 1444438016,
// file: 'ColgateComedyHourS6E1.mpg',
// hash: '4df210f9e64d63193e41bcfbb7e3b5c540a1e874',
// season: 6,
// episode: 1 },
// { size: 277512087,
// file: 'ColgateComedyHourS6E1.ogv',
// hash: '4df210f9e64d63193e41bcfbb7e3b5c540a1e874',
// season: 6,
// episode: 1 },
// { size: 257035508,
// file: 'ColgateComedyHourS6E1_512kb.mp4',
// hash: '4df210f9e64d63193e41bcfbb7e3b5c540a1e874',
// season: 6,
// episode: 1 } ]
});
- From video/torrent
metator.info('6B!@#$%^5B').then(res => {
console.log(res); //=> []
});
Running tests
npm test