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.54k stars 279 forks source link

Transcript not available in the selected language (en). #299

Closed pascalandy closed 3 days ago

pascalandy commented 1 week ago

To Reproduce

Steps to reproduce the behavior:

What code / cli command are you executing?

For example: I am running

yt --transcript https://www.youtube.com/watch\?v\=_0fy4vvUgiw > transcript.txt

Which Python version are you using?

Python 3.11.9

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

not sure it's via fabric-ai. But most video gets the captions

Expected behavior

Describe what you expected to happen.

I expected to receive the english transcript. It works for most videos

Actual behaviour

I see on youtube that captions is disabled. Maybe it's why.

Instead I received the following error message:

"Transcript not available in the selected language (en). (\nCould not retrieve a transcript for the video https://www.youtube.com/watch?v=UdJBqCI4dpU! This is most likely caused by:\n\nSubtitles are disabled for this video\n\nIf you are sure that the described cause is not responsible for this error and that a transcript should be retrievable, please create an issue at https://github.com/jdepoix/youtube-transcript-api/issues. Please add which version of youtube_transcript_api you are using and provide the information needed to replicate the error. Also make sure that there are no open issues which already describe your problem!)"
Asentient commented 5 days ago

Same issue here. It surfaced with me a few days ago too when it was working perfectly beforehand. I do not recall any updates to the code in that period so I am wondering maybe if there were any changes on Youtube's side that broke the tool for some.

Asentient commented 5 days ago

I can confirm now that in my case, this was IP related.

I get this message above as described by OP. if I try to use yt through my VPN, but it works perfectly fine when i use my ISP IP address to make the request. Please note that it used to work fine through my VPN and my static VPN Private IP has not changed which leads me to think that this policy change happened on youtube's side.

My issue is now resolved. Can OP confirm if they are using a VPN or not?

jdepoix commented 3 days ago

Hi @pascalandy,

I am not familiar with fabric-ai, but most likely your IP has been banned by YouTube as @Asentient already pointed out. Unfortunately, there's not much you can do here other than changing your IP address (through a VPN for example) or waiting until the ban has been lifted (for which there is no consistent information on how long this will take).

I'll close this now, as there's not much we can do.

pascalandy commented 2 days ago

So far, that was the only instance it happened.