Skip to content
/ vtt2srt Public

Convert VTT subtitles (as used YouTube and youtube-dl) to SRT format.

Notifications You must be signed in to change notification settings

jaluth/vtt2srt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

vtt2srt

Convert VTT subtitles (as used YouTube) to SRT format.

Requirements

Python 3.6+

USAGE:

python3 vtt2srt.py <input.vtt> <output.srt>

USAGE IN YOUR OWN PROJECTS

>>> import vtt2srt
>>> help(vtt2srt)

NAME
    vtt2srt - Convert .vtt subtitles to .srt format

FUNCTIONS
    main(input_file, output_file)
        Read VTT, convert, save to SRT

    read_vtt(filename)
        Read vtt into list

    vtt_to_srt(vtt)
        Convert VTT timestamps to SRT timestamps and insert SRT indeces

    write_srt(srt, filename)
        Write srt to disk

FILE
    vtt2srt/vtt2srt.py

About

Convert VTT subtitles (as used YouTube and youtube-dl) to SRT format.

Topics

Resources

Stars

Watchers

Forks

Languages