npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

subtitler

v2.7.0

Published

Command line and library to search and download subtitles.

Downloads

92

Readme

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

Search


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