How to get the transcript of a YouTube video

In this tutorial I will show you how to get the transcript of a YouTube video using youtube-transcript-api within a Python script. I’ll also show how to get it in alternative languages such as German

pip install youtube-transcript-api

Install this module before you go any further
from youtube_transcript_api import YouTubeTranscriptApi

tx = YouTubeTranscriptApi.get_transcript('gzRXsXQJXmw')
#print(tx)
for i in tx:
    print(i['text'])
This YouTube video to text converter will get all of the subtitles and then you can save the output as text

Donate to Jonas if you like this project