Convert YouTube transcriptions to .srt files
- Copy the transcripts from YouTube and save in a
.txtfile in the same directory as theyt2srt.pyscript.
Sample input file:
transcript.txt
00:00
"Who Shouldn't Consume Curcumin or Turmeric"
00:07
Following flax and wheatgrass,
00:09
turmeric is the third best-selling
00:11
botanical dietary supplement,
- Execute the
yt2srt.pyscript. It will collect all.txtfiles in the same directory and try to convert to.srt:
python3 yt2srt.py
- An output file with the same name and
.srtis created.
Sample output file:
transcript.srt
1
00:00:00,000 --> 00:00:07,000
"Who Shouldn't Consume Curcumin or Turmeric"
2
00:00:07,000 --> 00:00:09,000
Following flax and wheatgrass,
3
00:00:09,000 --> 00:00:11,000
turmeric is the third best-selling
4
00:00:11,000 --> 00:00:12,000
botanical dietary supplement,
- Manually adjust the the end time of the last entry in the
.srtfile for a better result.