This is a python API which allows you to get the transcript/subtitles for a given YouTube video. It also works for automatically generated subtitles and it does not require an API key nor a headless browser, like other selenium based solutions do!
I only write simple code like this
def transcript_video(): url = input("Enter the URL: ") transcript = YouTubeTranscriptApi.get_transcript(url, languages=['en'])
I only write simple code like this
def transcript_video(): url = input("Enter the URL: ") transcript = YouTubeTranscriptApi.get_transcript(url, languages=['en'])
but i got an error like this:
**Could not retrieve a transcript for the video https://www.youtube.com/watch?v=https://youtu.be/n8s9DjPDBEw! This is most likely caused by:
Subtitles are disabled for this video**
when I check the video, the subtitle is not disabled, is there anything wrong with the code that I write?