Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alxhotel/opensubtitles-js
:book: An Opensubtitles API wrapper for Node.js (unmantained)
https://github.com/alxhotel/opensubtitles-js
api-wrapper opensubtitles opensubtitles-api opensubtitles-js
Last synced: about 1 month ago
JSON representation
:book: An Opensubtitles API wrapper for Node.js (unmantained)
- Host: GitHub
- URL: https://github.com/alxhotel/opensubtitles-js
- Owner: alxhotel
- License: other
- Created: 2016-02-05T13:43:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-10-15T15:17:49.000Z (about 2 years ago)
- Last Synced: 2024-10-14T15:02:02.000Z (about 1 month ago)
- Topics: api-wrapper, opensubtitles, opensubtitles-api, opensubtitles-js
- Language: JavaScript
- Homepage:
- Size: 17.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# opensubtitles-js
[![NPM Version](https://img.shields.io/npm/v/opensubtitles-js.svg)](https://npmjs.com/package/opensubtitles-js)
[![Build Status](https://img.shields.io/github/workflow/status/alxhotel/opensubtitles-js/ci/master)](https://github.com/alxhotel/opensubtitles-js/actions)
[![Dependency Status](https://img.shields.io/librariesio/release/npm/opensubtitles-js)](https://libraries.io/npm/opensubtitles-js)**[Opensubtitles.org](http://opensubtitles.org) API wrapper for Node.js**
## Example usage
#### Setup
npm install opensubtitles-js
#### Login
```js
var Opensubtitles = require('opensubtitles-js');var subs = new Opensubtitles({
user: 'username',
password: 'password',
language: 'en',
userAgent: 'OSTestUserAgent'
})subs.login()
.then(function(token) {
console.log(token)
}).fail(function(error) {
console.log(error)
})
```Example output:
```js
tokenid1234567890
```#### Search Episodes
```js
var Opensubtitles = require('opensubtitles-js');var subs = new Opensubtitles()
var query = {
imdbid: "tt1844624",
season: "2",
episode: "3",
filename: "American.Horror.Story.S02E03.720p.HDTV.X264-DIMENSION"
}subs.searchEpisode(query)
.then(function(result) {
console.log(result)
}).fail(function(error) {
console.log(error)
})
```Example output:
```js
Object {
pt: {
url: 'http://dl.opensubtitles.org/en/download/filead/src-api/subs_name.srt',
lang: 'pt',
downloads: '56',
score: 0
},
nl: {
url: 'http://dl.opensubtitles.org/en/download/filead/src-api/subs_name.srt',
lang: 'nl',
downloads: '1598',
score: 100
},
es: {
url: 'http://dl.opensubtitles.org/en/download/filead/src-api/subs_name.srt',
lang: 'es',
downloads: '1576',
score: 100
}
}
```#### All Methods
*NOTE: Example outputs for these methods can be found at [Opensubtitles' documentation](http://trac.opensubtitles.org/projects/opensubtitles/wiki/XMLRPC)*
- LogIn(username, password, language, useragent)
- LogOut(token)
- SearchSubtitles(token, queries)
- SearchToMail(token, langs, movies)
- CheckSubHash(token, subsHash)
- CheckMovieHash(token, moviesHash)
- CheckMovieHash2(token, moviesHash)
- InsertMovieHash(token, moviesInfo)
- TryUploadSubtitles(token, sub)
- UploadSubtitles(token, sub)
- DetectLanguage(token, texts)
- DownloadSubtitles(token, subid)
- ReportWrongMovieHash(token, IDSubMovieFile)
- ReportWrongImdbMovie(token, movie)
- GetSubLanguages(language)
- GetAvailableTranslations(token, program)
- GetTranslation(token, iso639, format, program)
- SearchMovieOnIMDB(token, query)
- GetIMDBMovieDetails(token, imdbid)
- InsertMovie(token, movie)
- SubtitlesVote(token, vote)
- GetComments(token, subids)
- AddComment(token, comments)
- AddRequest(token, request)
- AutoUpdate(programName)
- NoOperation(token)## License
This code is based on [opensubtitles-api](https://github.com/vankasteelj/opensubtitles-api) done by [@vankasteelj](https://github.com/vankasteelj)
So, this code is registered under GPLv3
Author of this fork is [@alxhotel](http://github.com/alxhotel).