opensubtitles API & command line subtitles downloader

npm install opensubtitles-client
51 downloads in the last day
117 downloads in the last week
186 downloads in the last month

NPM Opensubtitles package

Build Status Donate



After have installed node.js, run the following:

npm install opensubtitles-client -g

Command line

subtitler <file|directory|seachText> 
    --lang eng|pob|... 
    -n <numberOfSubtitlesToDownload> 
    --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


-lang por 

-lang pob 

-lang eng

-lang fre

-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

Javascript API:

Login - get the login token from the opensubtitle service

        // got the auth token

Search - search for subtitles, lang, text)
            //got the search results

Search - search subtitles for a movie file

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

Logout - opensubtitles session logout ( please be nice! )



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){});

Integration with rtorrent

After rtorrent download is finish you can automatically use subtitler to download it's subtitles. You just have to do the following:

On .rtorrent.rc add:


This way the subtitler command will receive the downloaded path has argument and will try to download the subtitles.

Checkout my blogpost on:

Why this package was created!

Integration with Rtorrent

Visit for more informations, contacts and news about Web Development.

See other blog posts at

Thanks for all your code contributions!

Oscar Brito

npm loves you