question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyError: 'playerCaptionsTracklistRenderer'

See original GitHub issue
$ python
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from youtube_transcript_api import YouTubeTranscriptApi
>>> 
>>> YouTubeTranscriptApi.get_transcript('Fjg5lYqvzUs') 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\joshu\AppData\Local\Programs\Python\Python38\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\joshu\AppData\Local\Programs\Python\Python38\lib\site-packages\youtube_transcript_api\_api.py", line 70, in list_transcripts
    return TranscriptListFetcher(http_client).fetch(video_id)
  File "C:\Users\joshu\AppData\Local\Programs\Python\Python38\lib\site-packages\youtube_transcript_api\_transcripts.py", line 47, in fetch
    self._extract_captions_json(self._fetch_video_html(video_id), video_id)
  File "C:\Users\joshu\AppData\Local\Programs\Python\Python38\lib\site-packages\youtube_transcript_api\_transcripts.py", line 61, in _extract_captions_json
    captions_json = json.loads(
KeyError: 'playerCaptionsTracklistRenderer'
>>> YouTubeTranscriptApi.get_transcript('dZ5Uicedipc') 
[{'text': '[Music]', 'start': 0.59, 'duration': 2.14}, ...

I am using the latest version (0.4.2):

$ pip install --upgrade youtube_transcript_api
Requirement already satisfied: youtube_transcript_api in c:\users\joshu\appdata\local\programs\python\python38\lib\site-packages (0.4.2)

I don’t believe this is an issue with rate limiting or anything as it works perfectly fine on all other videos. In fact, I have downloaded transcripts for over 40000 videos and never had an issue.

If this error cannot be reproduced on your side, I will gladly give more information. Thanks 👍

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
xenovacommented, Nov 29, 2021

If you want, I can provide a pull request to fix it.

0reactions
xenovacommented, Nov 29, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve python keyerror - Stack Overflow
How to resolve this error? from urllib.request import urlopen import json import pandas as pd movieIdListURL = "http://www.kobis.
Read more >
pytube.__main__ — pytube 12.1.0 documentation
This module implements the core developer interface for pytube. The problem domain of the :class:`YouTube <YouTube> class focuses almost exclusively on the ...
Read more >
pytube.__main__ — pytube3 9.6.4 documentation
Source code for pytube.__main__. # -*- coding: utf-8 -*- """ This module implements the core developer interface for pytube.
Read more >
[youtube] Adapt to new automatic captions rendition ... - ZeroDream
except (KeyError, ExtractorError): except (KeyError, IndexError, ExtractorError): self._downloader.report_warning(err_msg). return {} ...
Read more >
Viewing online file analysis results for 'MINECR~1.EXE'
MM);kF(a.B,a.l,["keyerror","webkitkeyerror"],a. ... playerCaptionsTracklistRenderer?Lla(a,d.captions.playerCaptionsTracklistRenderer):(a.mr=void 0!=b.cap.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found