An open API service indexing awesome lists of open source software.

https://github.com/mrdotb/yifysubtitles


https://github.com/mrdotb/yifysubtitles

yifysubtitles

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![Build Status](https://travis-ci.org/mrdotb/yifysubtitles.svg?branch=master)](https://travis-ci.org/mrdotb/yifysubtitles)

# yifysubtitles
> Download and convert subtitles in [VTT format](https://developer.mozilla.org/en/docs/Web/API/Web_Video_Text_Tracks_Format) for [YTS movies](https://yts.ag/)

## Install

```bash
$ npm i yifysubtitles --save
```
Or using yarn
```bash
$ yarn add yifysubtitles
```

## Usage

```js
const yifysubtitles = require('yifysubtitles');

const results = await yifysubtitles('tt1156398', {
path: '/tmp',
langs: ['en', 'fr', 'zh']
});
console.log(results)
/*
[
{
lang: 'english',
langShort: 'en',
path: '/tmp/Zombieland.2009.720p.BrRip.x264-YIFY.vtt',
fileName: 'Zombieland.2009.720p.BrRip.x264-YIFY.vtt'
},
...
]
*/
```

## API

### yifysubtitles(imdbId, [options])

Returns an `Array` of the downloaded subtitles.

#### imdbId

Type: `String`

#### options

Type: `Object`

##### langs

Type: `Array`

Default: `['en']`

Array of the langs wanted.

##### path

Type: `String`

Default: `__dirname`

The path where the subtitles are going to be stored.

##### format

Type: `String`

Default: `vtt`

The format of subtitles. ['srt', 'vtt']

##### concurrency

Type: `number`

Default: `Infinity`

Minimum: `1`
Download multiples subtitles concurency.

## License

MIT © [Mrdotb](https://github.com/MRdotB)