1.0.12 • Published 9 years ago

node-opensubtitles v1.0.12

Weekly downloads
5
License
MIT
Repository
-
Last release
9 years ago

node-opensubtitles

An open source library to help you to download and search subtitles through the OpenSubtitles API.

Installation

npm install --save node-opensubtitles

Usage

var Os = require('node-opensubtitles');

var os = new Os({
	useragent: process.env.MY_USER_AGENT
});

os.LogIn(process.env.USERNAME, process.env.PASSWORD).then(function (res) {
	console.log(res);
});

os.SearchSubtitles([{
	query: 'breaking bad',
	sublanguageid: 'por',
	episode: 1,
	season: 1
}]).then(function (value) {
	console.log(value.data);
});

os.search([{
	query: 'breaking bad',
	episode: 1,
	season: 1,
	sublanguageid: 'por'
}]).then(function (value) {
	return os.download(value.map(function (value) {
		return value.IDSubtitleFile;
	}));
}).then(function (subtitles) {
	return Q.all(subtitles.map(function (buf, index) {
		return buf.save('./my-sub-' + index + '.srt');
	}));
});

API

  • os.search - Return an array, with the results.

  • os.download - Return an array of buffers, already base64 decoded and ready to save

1.0.12

9 years ago

1.0.11

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago