Socket
Book a DemoInstallSign in
Socket

subtitler

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

subtitler

Command line and library to search and download subtitles.

latest
Source
npmnpm
Version
2.7.0
Version published
Weekly downloads
16
-56.76%
Maintainers
1
Weekly downloads
 
Created
Source

Divhide

Subtitles library / command line

Donate Build Status NPM version

Install

After have installed node.js, run the following:

npm install subtitler -g

API

Login - get the login token from the opensubtitle service


var opensubtitles = require("subtitler");

opensubtitles.api.login()
.then(function(token){
	// got the auth token
});

var opensubtitles = require("subtitler");

opensubtitles.api.searchForFile(login, lang, movieFilePath);
.then(functions(results){
	//got the search results
});

opensubtitles.api.searchForTitle(token, lang, text)
.then(functions(results){
	//got the search results
});

opensubtitles.api.searchForTag(token, lang, tag)
.then(functions(results){
	//got the search results
});

opensubtitles.api.search(token, lang, {
	query: "",
	tag: ""
})
.then(functions(results){
	//got the search results
});

Logout - opensubtitles session logout ( please be nice! )


var opensubtitles = require("subtitler");

opensubtitles.api.logout(login);

Command line

subtitler <file|directory|seachText>
	--lang eng|pob|...
	-n <numberOfSubtitlesToDownload>
	--download
	--retries <numberOfRetries>
	--retryIn <secondsToRetry>

if a file or directory is provided -- download is activated by default

if free text is provided -- performs a query into opensubtitles with it!

--lang The language to search. Defaults to LANG environment variable.

-n specifies the number of subtitles to list or download if (--download is specified)

--download Flag to download the results. The downloaded result will have the same same as the file if it can, working well with TV players, etc...

--retries The number of retries in API error

--retryIn The seconds to wait before the next retry

Languages

//Portuguese
--lang por

//Brazilian
--lang pob

//English
--lang eng

 //French
--lang fre

//Spanish
--lang spa

Check the languages table on here. Or the languages aliases on here.

Examples

Download subtitles for a file, automatically naming the subtitle file to be the same as the movie.

subtitler Cars.avi --lang en_us
LANG=en_us subtitler Cars.avi

Search for subtitles (limit 5):

subtitler Cars --lang eng --n 5

Search and download to the current directory the first 5 subtitles:

subtitler Cars --lang eng -n 5 --download

Contribute

Pull requests are welcome but please make sure the the linting and unit tests are working before you do that. Also adding unit tests will increase the acceptance of the pull request by 10000%!


grunt dev

Authors

Oscar Brito

Keywords

subtitle

FAQs

Package last updated on 03 Sep 2019

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