Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hogart/vtt2srt
https://github.com/hogart/vtt2srt
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hogart/vtt2srt
- Owner: hogart
- Created: 2014-12-16T11:27:26.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-16T11:29:45.000Z (about 10 years ago)
- Last Synced: 2024-11-03T05:32:59.442Z (2 months ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vtt2srt
[WebVTT](http://en.wikipedia.org/wiki/SubRip#WebVTT) to [.srt](http://en.wikipedia.org/wiki/SubRip#SubRip_text_file_format) converter. Sometimes bad internet connection leaves you no option but to download some videos instead of watching them in your browser. But those videos often come with closed captions in WebVTT, and this format is not widely supported in media players yet.
## Installation
`npm install vtt2srt`
`bower install vtt2srt`
Or download and include vtt2srt.js manually in your page.
## Programmatic usage
```javascript
var fs = require('fs');
var vtt2srt = require('vtt2srt');var vtt = fs.readFile('captions.vtt', function (err, captionsBuff) {
console.log(vtt2srt(vtt));
});
```## Commandline converter
```
node bin/convert.js < elephants_dream.vtt > elephants_dream.srt
```