youtube-captions
Install
gem install youtube-captionsor add to gemfile
gem "youtube-captions"Usage
# "id" can be video url
video = YoutubeCaptions::Video.new(id: "abc123")Captions with default language
=> video.captions
=> [
{
"__content__" => "Welcome to Ruby",
"start" => "0.16",
"dur" => "3.92"
}
...
]Captions with specific language (must be available)
=> video.captions(lang: "es")
=> [
{
"__content__" => "Bienvenido a Ruby",
"start" => "0.16",
"dur" => "3.92"
}
...
]Available languages
=> video.available_langs
=> ["es", "en", "pt"]Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Show your support
Give a ⭐️ if you like this project!