https://github.com/algolia/youtube-captions-scraper
Fetch youtube user submitted or fallback to auto-generated captions
https://github.com/algolia/youtube-captions-scraper
Last synced: about 1 year ago
JSON representation
Fetch youtube user submitted or fallback to auto-generated captions
- Host: GitHub
- URL: https://github.com/algolia/youtube-captions-scraper
- Owner: algolia
- Created: 2017-11-22T09:32:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-28T08:20:51.000Z (over 2 years ago)
- Last Synced: 2025-06-02T22:40:03.775Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 158 KB
- Stars: 296
- Watchers: 65
- Forks: 70
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Youtube Captions scraper
> Fetch youtube user submitted or fallback to auto-generated captions
## Installation
* `> npm install -S youtube-captions-scraper` OR
* `> yarn add youtube-captions-scraper`
## Usage
```js
// ES6 / TypeScript
import { getSubtitles } from 'youtube-captions-scraper';
getSubtitles({
videoID: 'XXXXX', // youtube video id
lang: 'fr' // default: `en`
}).then(captions => {
console.log(captions);
});
// ES5
var getSubtitles = require('youtube-captions-scraper').getSubtitles;
getSubtitles({
videoID: 'XXXXX', // youtube video id
lang: 'fr' // default: `en`
}).then(function(captions) {
console.log(captions);
});
```
Captions will be an array of object of this format:
```js
{
"start": Number,
"dur": Number,
"text": String
}
```