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

i got this error #202

Closed MatinMollapur01 closed 1 year ago

MatinMollapur01 commented 1 year ago

Traceback (most recent call last): File "main.py", line 5, in transcript_list = YouTubeTranscriptApi.get_transcript(video_id) File "/home/runner/transcriptapitest/venv/lib/python3.10/site-packages/youtube_transcript_api/_api.py", line 132, in get_transcript return cls.list_transcripts(video_id, proxies, cookies).find_transcript(languages).fetch() File "/home/runner/transcriptapitest/venv/lib/python3.10/site-packages/youtube_transcript_api/_api.py", line 71, in list_transcripts return TranscriptListFetcher(http_client).fetch(video_id) File "/home/runner/transcriptapitest/venv/lib/python3.10/site-packages/youtube_transcript_api/_transcripts.py", line 47, in fetch self._extract_captions_json(self._fetch_video_html(video_id), video_id) File "/home/runner/transcriptapitest/venv/lib/python3.10/site-packages/youtube_transcript_api/_transcripts.py", line 59, in _extract_captions_json raise TranscriptsDisabled(video_id) youtube_transcript_api._errors.TranscriptsDisabled: Could not retrieve a transcript for the video https://www.youtube.com/watch?v=https://www.youtube.com/watch?v=aJHt-BXNYh0! 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! 

jdepoix commented 1 year ago

As you didn't provide any code I don't know what you are executing, but looking at the error message it looks like you have passed the whole video URL into get_transcript instead of only the video id.