Skip to content

mathewjoe/node-osdb-hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Opensubtitles API (OSDb protocol) Hash Implementation

Implementation of the OSDb hash in nodejs, for use with Opensubtitles Database (OSDb)

Installation

$ npm install node-osdb-hash

Usage

Synchronous

var osh = require('node-osdb-hash');
var hash = osh.hashSync('/path/to/movie/file');
console.log(hash); // Eg : '8e245d9679d31e12'

Asynchronous

var osh = require('node-osdb-hash');
osh.hash('/path/to/movie/file', function (err, hash) {
	if(err) return console.error(err);
	console.log(hash); // Eg : '8e245d9679d31e12'
}

Using Events

var osh = require('node-osdb-hash');
var hasher = osh.hash('/path/to/movie/file');
hasher.on('hashReady', function (hash){
	console.log(hash); // Eg : '8e245d9679d31e12'
}
hasher.on('error', function (err) {
	console.error(err);
}
hasher.calculateHash();

About

Implementation of the OSDb hash in nodejs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published