# subdb

> API to interact with subdb services

Latest version **0.0.3** (published 2015-07-21) · GPL license · 0 weekly downloads

## Install

```sh
npm install subdb
pnpm add subdb
yarn add subdb
bun add subdb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2015-07-21 |
| First published | 2012-10-08 |
| Weekly downloads | 0 |
| License | GPL |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | ka2er |
| Maintainers | ka2er |
| Keywords | subdb |

## Links

- npm: https://www.npmjs.com/package/subdb
- Repository: https://github.com/ka2er/node-subdb-api
- Issues: http://github.com/ka2er/node-subdb-api/issues
- npm.io page: https://npm.io/package/subdb

## Dependencies (2)

- [clone](https://npm.io/package/clone.md) 0.1.x
- [form-data](https://npm.io/package/form-data.md) 0.0.x

## Recent versions

- 0.0.3 (latest) — 2015-07-21
- 0.0.2 — 2015-03-01
- 0.0.1 — 2012-10-08

## README

node-subdb-api
==============

Node.js API library to query thesubdb.com

![build status](https://travis-ci.org/ka2er/node-subdb-api.svg?branch=master)

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

``` javascript
subdb.computeHash(path_to_movie, callback);
```
For searching a sub file

``` javascript
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

``` javascript
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
});
```

---
_Source: https://npm.io/package/subdb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
