smartvain / youtube-caption-displayer
This package allows you to get subtitles from youtube.
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/smartvain/youtube-caption-displayer
Requires
- php: ^7.3|^8.0
- guzzlehttp/guzzle: ^7.0.1
- laravel/framework: ^8.75
This package is auto-updated.
Last update: 2025-12-12 23:11:44 UTC
README
You can install it by typing the following command in a terminal.
$ composer require smartvain/youtube-caption-displayer # or composer require --dev
Install with Packagist
Prepared methods
- getLangList()
- getCaptionsWithSeconds()
- getCaptionText()
Usage
First, add a Use declaration anywhere.
use Smartvain\YoutubeCaptionDisplayer\Displayer;
All that remains is to call the method with Facade.
Get the language list used for youtube video subtitles with getLangList().
Next, since the obtained language list contains lang-code, use it to get subtitles by getCaptionsWithSeconds() or getCaptionText().
If it is a youtube video without subtitles, return empty Collection.
It's so easy.