opensubtitles-client

opensubtitles client and command line subtitles downloader

NPM Opensubtitles package


After have installed node.js, run the following:

npm install opensubtitles-client -g
opensubtitles.api.login()
    .done(function(token){
        // got the auth token 
    });
opensubtitles.api.search(token, lang, text)
    .done(
        functions(results){
            //got the search results 
        }
    );
opensubtitles.api.searchForFile(login, lang, movieFilePath);
    .done(
        functions(results){
            //got the search results 
        }
    );
opensubtitles.api.logout(login);
opensubtitles.api.on("login", functions(token){});
opensubtitles.api.on("search", functions(results){});
opensubtitles.api.on("error", functions(e){});
 
opensubtitles.downloader.on("downloading", function(info){});
opensubtitles.downloader.on("downloaded", function(info){});
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 ( be sure to check here )

-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

//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.

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

subtitler Cars.avi -lang eng

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

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
 

Oscar Brito