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: 'streamingData'

See original GitHub issue

I was trying to download https://www.youtube.com/watch?v=NdA778dQrXE

And this always raises KeyError: ‘streamingData’ error.

>>> YouTube("https://www.youtube.com/watch?v=NdA778dQrXE")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pytube\__main__.py", line 92, in __init__
    self.descramble()
  File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pytube\__main__.py", line 132, in descramble
    apply_descrambler(self.player_config_args, fmt)
  File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pytube\extract.py", line 281, in apply_descrambler
    formats = json.loads(stream_data["player_response"])["streamingData"]["formats"]
KeyError: 'streamingData'

List of some videos raises the same error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:25

github_iconTop GitHub Comments

4reactions
thisismygitrepocommented, Apr 4, 2022

Apparently the view I’m trying to download is age restricted

https://www.youtube.com/watch?v=v4HkASndEXo

The error is not intuitive.

1reaction
scottflemingcommented, Jul 8, 2022

Same issue here, error appears to occur with age restricted videos…

Read more comments on GitHub >

github_iconTop Results From Across the Web

KeyError: 'streamingData' · Issue #743 · pytube ... - GitHub
I was trying to download https://www.youtube.com/watch?v=NdA778dQrXE And this always raises KeyError: 'streamingData' error.
Read more >
KeyError with pytube module - python - Stack Overflow
This is a know problem with the module but I cannot find any solutions, only complaints. I need to know how to fix...
Read more >
pytube keyerror: 'content-length' - You.com | The Search ...
The bug Iam getting the KeyError: 'content-length' while downloading videos, specifically for this one, when ever I try to download this video in...
Read more >
Developers - KeyError: 'streamingData' - - Bountysource
A simple, yet versatile Python package for downloading YouTube videos. See More. Top Supporters. This team needs your support! BECOME ...
Read more >
Fixing KeyError Exceptions in Python - YouTube
When you encounter a KeyError, there are a few standard ways to handle it. Depending on your use case, some of these solutions...
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