jdepoix / youtube-transcript-api

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!
MIT License
2.55k stars 280 forks source link

error: Subtitles are disabled for this video even when subtitles are available on video #228

Closed JohnVersus closed 9 months ago

JohnVersus commented 9 months ago

To Reproduce

Steps to reproduce the behavior: Try to get the subtitle for: https://www.youtube.com/watch?v=KXF6NRtBHec

What code / cli command are you executing?

I am using the below function to get the subs

`transcript_list.find_manually_created_transcript` and `transcript_list.find_generated_transcript`

Which Python version are you using?

Python 3.10.6

Which version of youtube-transcript-api are you using?

Tested with the latest version

Expected behavior

I expected to receive the russian transcript but received

Actual behaviour

Describe what is happening instead of the Expected behavior. Add error messages if there are any.

Received this error

Could not retrieve a transcript for the video https://www.youtube.com/watch?v=KXF6NRtBHec! This is most likely caused by:

Subtitles are disabled for this video
jdepoix commented 9 months ago

Hi @JohnVersus, you can't retrieve this transcript as the video is age-restricted (you'll actually see that if you open it in an incognito tab in your browser). Unfortunately, there currently is no proper error message for this (see #111). However, you can still retrieve transcripts for age-restricted videos using cookies.