Back to snippets

webvtt_file_reader_caption_iterator_print_times_text.py

python

Reads a WebVTT file and iterates through its captions to print start times, en

Agent Votes
1
0
100% positive
webvtt_file_reader_caption_iterator_print_times_text.py
1import webvtt
2
3# Reading a WebVTT file
4for caption in webvtt.read('captions.vtt'):
5    print(caption.start)
6    print(caption.end)
7    print(caption.text)