Closed chand1012 closed 1 year ago
This line seems to be the problem.
I stored the raw HTML as a file for this video and then tried to manually search for the string "captions":
in the html and found nothing. I hope that there is a way around this, but for now I hope this information helps someone fix the issue.
Okay, this seems to have been user error. I was accidentally inputting the entire video URL rather than just the ID to the video. Sorry for the inconvenience!
For example, this will not work.
python -m youtube_transcript_api https://www.youtube.com/watch\?v\=fE2sunDZhzg
But this will:
python -m youtube_transcript_api fE2sunDZhzg
To Reproduce
Steps to reproduce the behavior:
Which Python version are you using?
3.10.10 on M1 Mac
Which version of youtube-transcript-api are you using?
0.5.0
What code / cli command are you executing?
youtube_transcript_api https://www.youtube.com/watch\?v\=-f906Sy79hA
anddata = { 'url': 'https://www.youtube.com/watch\?v\=-f906Sy79hA' } resp = YouTubeTranscriptApi.get_transcript(data['url'].split("=")[-1])
Could not retrieve a transcript for the video https://www.youtube.com/watch?v=https://www.youtube.com/watch?v=-f906Sy79hA! This is most likely caused by:
Subtitles are disabled for this video
If 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!