subtitles seem enabled, but do not load
See original GitHub issueThank you very much for maintianing youtube-transcript-api!
I got stuck with subtutles that do not load, even though I enabled them in video, and switched of content under 18 flag for video and the channel. Maybe these changes take a while to take effect, but I do see subtitles in video.
I try the following code:
from youtube_transcript_api import YouTubeTranscriptApi as YT
video_id = "oUzcoYAwYyI"
YT.get_transcripts(video_id, languages=['ru'])
it fails with:
File "tc.py", line 3, in <module>
YT.get_transcripts(video_id, languages=['ru'])
File "C:\Users\epogr\Anaconda3\lib\site-packages\youtube_transcript_api\_api.py", line 102, in get_transcripts
raise exception
File "C:\Users\epogr\Anaconda3\lib\site-packages\youtube_transcript_api\_api.py", line 99, in get_transcripts
data[video_id] = cls.get_transcript(video_id, languages, proxies, cookies)
File "C:\Users\epogr\Anaconda3\lib\site-packages\youtube_transcript_api\_api.py", line 128, in get_transcript
return cls.list_transcripts(video_id, proxies, cookies).find_transcript(languages).fetch()
File "C:\Users\epogr\Anaconda3\lib\site-packages\youtube_transcript_api\_api.py", line 70, in list_transcripts
return TranscriptListFetcher(http_client).fetch(video_id)
File "C:\Users\epogr\Anaconda3\lib\site-packages\youtube_transcript_api\_transcripts.py", line 36, in fetch
self._extract_captions_json(self._fetch_video_html(video_id), video_id)
File "C:\Users\epogr\Anaconda3\lib\site-packages\youtube_transcript_api\_transcripts.py", line 48, 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=o! 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!
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Subtitles Not Working? Top Five Most Common Caption ...
But when you load up your video and display your captions, things don't look right. Apostrophes or foreign characters may appear as other ......
Read more >I'm having trouble with closed captions/subtitles - Hulu Help
If captions/subtitles appear to be out of sync, an error may have occurred when first loading the video. If you restart the stream...
Read more >How to fix no subtitles in VLC player on Windows 10
Open VLC player and play the video that is supposed to have subtitles. Right-click inside the player and go to Subtitle. The sub-menu...
Read more >Videos/subtitles not displayed in some browsers (including ...
Confirmed on both Beta2 in Ubuntu & build 176 on Windows XP. Windows 8.1 displays video but do not load subtitles.
Read more >Troubleshoot captions-related issues – Help Center - Vimeo
If your subtitles or captions don't appear during playback, make sure you've activated the caption file by toggling it on. You can toggle...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @epogrebnyak,
get_transcripts
takes anIterable
of video IDs. So if you pass in a single string containing a video id it will iterate through each character of that string considering it a video id. You’ll have to either door
I think a few people have stumble over this, as
get_transcripts
gets easily confused withget_transcript
. I think I will add anassert
toget_transcripts
to make sure the passed in video id param is not a string, to make the mistake more obvious.@epogrebnyak the static methods
get_transcript
andget_transcripts
really only are convenience-wrappers around theTranscriptList
object. Look at this example if you want to useTranscriptList
objects instead, which give you more options.