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!
DO NOT DELETE THIS! Please take the time to fill this out properly. I am not able to help you if I do not know what you are executing and what error messages you are getting. If you are having problems with a specific video make sure to include the video id.
Which version of youtube-transcript-api are you using?
youtube-transcript-api 0.6.2
Expected behavior
I expected to receive a transcript as the video on Youtube does have a transcript.
Actual behaviour
It throws an error saying that it couldn't retrieve a transcript and that subtitles might be disabled.
Instead I received the following error message:
raise TranscriptsDisabled(video_id)
youtube_transcript_api._errors.TranscriptsDisabled:
Could not retrieve a transcript for the video https://www.youtube.com/watch?v=RBTiTcHm_ac&ab! This is most likely caused by:
DO NOT DELETE THIS! Please take the time to fill this out properly. I am not able to help you if I do not know what you are executing and what error messages you are getting. If you are having problems with a specific video make sure to include the video id.
To Reproduce
Request transcript for "https://www.youtube.com/watch?v=RBTiTcHm_ac&ab_channel=Vox" (video_id = RBTiTcHm_ac&ab)
What code / cli command are you executing?
transcripts = YouTubeTranscriptApi.get_transcript(video_id)
Which Python version are you using?
Python 3.12
Which version of youtube-transcript-api are you using?
youtube-transcript-api 0.6.2
Expected behavior
I expected to receive a transcript as the video on Youtube does have a transcript.
Actual behaviour
It throws an error saying that it couldn't retrieve a transcript and that subtitles might be disabled.
Instead I received the following error message:
raise TranscriptsDisabled(video_id) youtube_transcript_api._errors.TranscriptsDisabled: Could not retrieve a transcript for the video https://www.youtube.com/watch?v=RBTiTcHm_ac&ab! This is most likely caused by:
Subtitles are disabled for this video