New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

subdb

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

subdb

API to interact with subdb services

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

node-subdb-api

Node.js API library to query thesubdb.com

build status

Usage

  • All api methods are available through subdb.api attributes (see http://thesubdb.com/api/ for methods and arguments).
  • A hash method helper is also available
subdb.computeHash(path_to_movie, callback);

For searching a sub file

var SubDb = require("subdb");

var subdb = new SubDb();
subdb.computeHash(path_to_movie, function(err, res) {
	if(err) return err;

	var hash = res;
	subdb.api.search_subtitles(hash, function(err, res){

		if(err) return err;

		subdb.api.download_subtitle(hash, res.join(','), 'pathtosub.srt', function(err, res) {
			if(err) return err;

			// sub is normally fetched into pathtosub.srt
		});

	});
});

For uploading a sub file

var SubDb = require("subdb");

var subdb = new SubDb();
subdb.api.upload_subtitle(hash, subfile, function(err, res){
	if(err) return err;

	// sub subfile is normally uploaded to thesubdb.com servers
});

Keywords

subdb

FAQs

Package last updated on 21 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts