All Projects → benwiley4000 → youtube-vtt

benwiley4000 / youtube-vtt

Licence: MIT license
▶️ Extract and save WebVTT closed caption tracks from YouTube videos

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to youtube-vtt

ccaptioner
An extension to assign a text track to a video element in a web page
Stars: ✭ 45 (+40.63%)
Mutual labels:  captions, subtitles, vtt
pysubs2
A Python library for editing subtitle files
Stars: ✭ 174 (+443.75%)
Mutual labels:  subtitles, webvtt, closed-captions
Elgindy-VTT-to-SRT-Subtitle-Converter
A tool for converting Web Video Text Tracks Format (WebVTT) subtitle to srt one. As most of video players support srt subtitles and can't open vtt subtitles, We should convert vtt to srt or sub subtitles but it's not easy to do that.
Stars: ✭ 68 (+112.5%)
Mutual labels:  subtitles, vtt, webvtt
srt-to-vtt-converter
A simple application for quickly converting subtitle files from SubRib (.srt) format to WebVTT (.vtt) format.
Stars: ✭ 56 (+75%)
Mutual labels:  vtt, webvtt
VTT-to-SRT-Converter
Convert WebVTT subtitles to SubRip.
Stars: ✭ 29 (-9.37%)
Mutual labels:  vtt, webvtt
CCAligner
🔮 Word by word audio subtitle synchronisation tool and API. Developed under GSoC 2017 with CCExtractor.
Stars: ✭ 131 (+309.38%)
Mutual labels:  subtitles, closed-captions
nekocap
Browser extension for creating & uploading community captions for YouTube, niconico and other video sharing sites.
Stars: ✭ 27 (-15.62%)
Mutual labels:  captions, subtitles
vtt-creator
Very basic Node.js/JavaScript library to generate VTT open subtitles files
Stars: ✭ 22 (-31.25%)
Mutual labels:  subtitles, vtt
Ffsubsync
Automagically synchronize subtitles with video.
Stars: ✭ 5,167 (+16046.88%)
Mutual labels:  captions, subtitles
simple-obs-stt
Speech-to-text and keyboard input captions for OBS.
Stars: ✭ 89 (+178.13%)
Mutual labels:  captions, subtitles
ebu-tt-live-toolkit
Toolkit for supporting the EBU-TT Live specification
Stars: ✭ 23 (-28.12%)
Mutual labels:  captions, subtitles
Hulusubs dl
Command line script that downloads subtitles from hulu.com
Stars: ✭ 42 (+31.25%)
Mutual labels:  vtt
Dungeoneer
A game master helper tool, includes a virtual tabletop, initiative tracker, combat tracker and homebrew management for Dungeons and Dragons 5e.
Stars: ✭ 106 (+231.25%)
Mutual labels:  vtt
forbidden-lands-foundry-vtt
This is a Forbidden Lands game System for the Foundry Virtual Table Top. Made by @Perfectro, @patrys and @aMediocreDad. Maintained by @aMediocreDad, @narukaioh
Stars: ✭ 28 (-12.5%)
Mutual labels:  vtt
subscene scraper
Library to download subtitles from subscene.com
Stars: ✭ 14 (-56.25%)
Mutual labels:  subtitles
libgosubs
golang library to read and write various subtitle formats
Stars: ✭ 20 (-37.5%)
Mutual labels:  subtitles
subox
Subox是一个基于 Electron 开发的以媒体资源文件为基础的字幕搜索桌面应用。可根据设定的搜索目录和忽略路径索引所有可播放的资源文件,并且以文件名为基础索引字幕文件或者辅助搜索字幕文件并下载。
Stars: ✭ 17 (-46.87%)
Mutual labels:  subtitles
amazon-ivs-auto-captions-web-demo
Use Amazon IVS in conjunction with Amazon Transcribe to deliver real-time captions for live streams.
Stars: ✭ 36 (+12.5%)
Mutual labels:  captions
immersive
Language learning mpv script for looking up words within mpv and generating Anki cards
Stars: ✭ 43 (+34.38%)
Mutual labels:  subtitles
stagedisplayviewer
Stage display viewer in java for propresenter
Stars: ✭ 30 (-6.25%)
Mutual labels:  subtitles

youtube-vtt

Extract and save WebVTT (.vtt) closed caption files from YouTube videos.

YouTube videos don't use a standard closed caption format so this script parses that format and converts it into the WebVTT format. The exported caption files can be used to display native captions in any browser supporting the HTML video element.

How to use

Simple usage (visiting page in browser)

  1. Open a YouTube video with closed captions in a web browser

  2. Open the JavaScript console (in Chrome this is Ctrl+Shift+J/Cmd+Option+J/).

  3. Paste the contents of save-vtt-files.js and hit Enter.

  4. Run the command to export and save a .vtt file for each caption track:

    a. To export with default settings, just run:

    saveVttFiles();

    b. By default we're making only one caption display at a time, but YouTube saves the captions in overlapping (two-at-a-time) fashion, which makes sense for the way YouTube shows captions. If you'd like to preserve the overlapping durations, you can run this instead:

    AVOID_CONCURRENT_CAPTIONS = false;
    saveVttFiles();

    c. If you'd like your captions to be auto-translated into a different language by YouTube, you can specify the language code as an option:

    saveVttFiles({ translationLanguageCode: 'zh-Hans' });
  5. For each caption track, a file will be saved called [Video Title]-[Language Code].vtt.

Command line usage

Alternatively, you can use a CLI which allows you to trigger downloads in a more automated fashion.

Installation

npm install -g youtube-vtt

You also must have the Google Chrome browser (not Chromium) installed on your system or the commands below will fail.

Examples

Download captions for a video (vtt files go into a downloads directory under the current working path):

youtube-vtt https://www.youtube.com/watch?v=XXXXXXXXXXX

Translate downloaded captions to Simplified Chinese:

youtube-vtt https://www.youtube.com/watch?v=XXXXXXXXXXX --translation zh-Hans

Allow concurrent timespans for captions (disabled by default):

youtube-vtt https://www.youtube.com/watch?v=XXXXXXXXXXX --concurrent

Wait only one second for downloads to complete (default wait time is 5 seconds):

youtube-vtt https://www.youtube.com/watch?v=XXXXXXXXXXX --wait 1000

Wait 15 seconds for downloads to complete (if you have a slow connection):

youtube-vtt https://www.youtube.com/watch?v=XXXXXXXXXXX --wait 15000

Run in debug mode. The browser will open a window rather than running in the background, and it will wait for you to close it manually, allowing you to interact with the browser and inspect the page.

youtube-vtt https://www.youtube.com/watch?v=XXXXXXXXXXX --debug

FAQ

Can I use this to get captions from a YouTube live stream?

If the live stream will eventually complete (e.g. a live stream of an event that lasts for a few hours), and you're able to wait, then the commands above will work for that recording once it has completed.

However, if you need to get captions from a live stream in progress, you can't yet use youtube-vtt or saveVttFiles(). I do have experimental code that will work to get captions for a live stream, which can be found here. I'm still trying to figure out the best way to integrate this with the main code base, so let me know if you have any suggestions. I'm still wondering what the main use case for consuming captions from a live stream would be.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].