youtube-transcript-api icon indicating copy to clipboard operation
youtube-transcript-api copied to clipboard

No longer getting transcripts

Open shaylafolson opened this issue 7 years ago • 7 comments

Hello,

I was able to get transcripts for videos about a month ago, but it seems that all attempts now return an error that the transcripts aren't available. I have tried multiple videos. Thanks

shaylafolson avatar Oct 29 '19 20:10 shaylafolson

Have you tried upgrading your youtube-transcript-api package? There were quite a few issues opened about 20 days ago when youtube changed their formatting for the captions, so if you haven't updated in the last month you could be experiencing that bug.

If you are on the latest version of the package, could you please provide which video IDs are not working for you now, because I tested a few random vids and the package was working for me.

Thanks

danielcliu avatar Oct 29 '19 21:10 danielcliu

Thank you! I thought I had updated, but I'm a novice in python, so it was a simple mistake. Sorry!

shaylafolson avatar Oct 29 '19 21:10 shaylafolson

Its no problem. Glad you got it working!

danielcliu avatar Oct 29 '19 21:10 danielcliu

I'm sorry for disturbing you, I am using the latest version 0.1.9, however, I get an error. The error message is as follows.

Traceback (most recent call last):   File "E: \ 06_python_venvs \ youtube_data_lesson4 \ lib \ site-packages \ youtube_transcript_api \ _api.py", line 95, in get_transcript     return _TranscriptParser (_TranscriptFetcher (video_id, languages, proxies) .fetch ()). parse ()   File "E: \ 06_python_venvs \ youtube_data_lesson4 \ lib \ site-packages \ youtube_transcript_api \ _api.py", line 121, in fetch     + len (self.TIMEDTEXT_STRING) + 1 IndexError: list index out of range

I am trying to take the caption of the video here.

https://www.youtube.com/watch?v=wIjK-6Do6lg

Anything is fine so please help me!

microwriting avatar Oct 30 '19 09:10 microwriting

I'm sorry. I just made a mistake here. Wrong) YouTubeTranscriptApi.get_transcripts(video_id) Correct) YouTubeTranscriptApi.get_transcript(video_id)

microwriting avatar Oct 30 '19 10:10 microwriting

I am new here. I am using youtube transcript api to get the subtitles; but the times of "duration" keys do not seem correct to me. Because they overlap. Is there a way to find out the start and end date of each word spoken in the video? Help me please. Its important to me.

sekpona1-crypto avatar Dec 17 '21 16:12 sekpona1-crypto

@sekpona1-crypto The duration is the on-screen time of the subtitle box on YouTube. Since there usually are at least two subtitle boxes overlapping, durations will also overlap. There's no way to work around this as the information when a sentence ends is not available.

jdepoix avatar Dec 17 '21 16:12 jdepoix