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

Unable to retrieve transcript for YouTube video using youtube_transcript_api #294

Closed Alefiya21 closed 3 weeks ago

Alefiya21 commented 3 weeks ago

I'm experiencing an issue with retrieving the transcript for a YouTube video using the youtube_transcript_api library. I've checked the video ID, transcript availability, and API status, but the issue persists.

Version: 0.6.2

Code:


from youtube_transcript_api import YouTubeTranscriptApi

video_id = "R0jEmIlydqyrZgX6"
transcript_text = YouTubeTranscriptApi.get_transcript(video_id)
neonwatty commented 3 weeks ago

The video_id you provide is 16 characters long.

It looks like the length of a youtube video id is 11, not 16.

I get a "no file exists" reply when attempting to visit the youtube video associated with the id you provide

https://www.youtube.com/watch?v=R0jEmIlydqyrZgX6

Make sure you have the right id.

jdepoix commented 3 weeks ago

You haven't provided the exact error you're getting, but indeed it looks like your video ID is not valid. I'll close this now.