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

No transcripts were found for any of the requested language codes: ('en',) #275

Closed ayushgaikwad1210 closed 2 months ago

ayushgaikwad1210 commented 2 months ago

raise NoTranscriptFound( youtube_transcript_api._errors.NoTranscriptFound: Could not retrieve a transcript for the video https://www.youtube.com/watch?v=PnPc2xDwMvQ! This is most likely caused by:

No transcripts were found for any of the requested language codes: ('en',)

For this video (PnPc2xDwMvQ) transcripts are available in the following languages:

(MANUALLY CREATED) None

(GENERATED)

(TRANSLATION LANGUAGES)

Which Python version are you using?

Python x.y

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

youtube-transcript-api x.y.z

Expected behavior

Describe what you expected to happen.

For example: I expected to receive the english transcript

Actual behaviour

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

For example: Instead I received the following error message:

# ... error message ...
ayushgaikwad1210 commented 2 months ago

help me please

kingrishabdugar commented 2 months ago

@ayushgaikwad1210 I believe there is some error with your code. Try the below snippet it's working fine for me. For example I have retrieved the autogenerated Hindi subtitles :

from youtube_transcript_api import YouTubeTranscriptApi

//retrieve the available transcripts transcript_list = YouTubeTranscriptApi.list_transcripts('PnPc2xDwMvQ')

//automatically generated ones
transcript = transcript_list.find_generated_transcript(['hi']) print (transcript.fetch())

jdepoix commented 2 months ago

There's is no way to help without knowing what you are executing. Please fill out the issue template properly!