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.

Demo example broken (KeyError: 'url_encoded_fmt_stream_map')

See original GitHub issue

I’ve noticed this error since yesterday (used to work, failed from one minute to the next).

I’m new to pytube, but I believe this is related to issue #467 which also shows some recent activity.

Feel free to mark this as a duplicate, just wanted to create a new issue to point out that the actual demo from the 101 documentation stopped working.

>>> from pytube import YouTube
>>> YouTube('https://youtu.be/9bZkp7q19f0').streams.first().download()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jan/.local/share/virtualenvs/pycast-pLleJR-U/lib/python3.7/site-packages/pytube/__main__.py", line 88, in __init__
    self.prefetch_init()
  File "/Users/jan/.local/share/virtualenvs/pycast-pLleJR-U/lib/python3.7/site-packages/pytube/__main__.py", line 97, in prefetch_init
    self.init()
  File "/Users/jan/.local/share/virtualenvs/pycast-pLleJR-U/lib/python3.7/site-packages/pytube/__main__.py", line 143, in init
    mixins.apply_descrambler(self.player_config_args, fmt)
  File "/Users/jan/.local/share/virtualenvs/pycast-pLleJR-U/lib/python3.7/site-packages/pytube/mixins.py", line 96, in apply_descrambler
    for i in stream_data[key].split(',')
KeyError: 'url_encoded_fmt_stream_map'

UPDATE: The pytube project appears unmaintained at the moment. See here.

  • If you are looking to fix the problem mentioned in this issue and are happy to patch source code, follow the advice given in #467 .
  • If this is not acceptable, pytube might not be right for you. pytube3 (see below) could be an option.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:14
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
hbmartincommented, Jan 21, 2020
0reactions
github-actions[bot]commented, Aug 16, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python KeyError Exceptions and How to Handle Them
In this tutorial, you'll learn how to handle Python KeyError exceptions. They are often caused by a bad key lookup in a dictionary,...
Read more >
How to Fix KeyError Exceptions in Python - Rollbar
The Python KeyError is an exception that occurs when an attempt is made to access an item in a dictionary that does not...
Read more >
Unable to run demo: Key error "data" · Issue #89 - GitHub
I am struggling to follow the example. It fails when importing Analyze from data_lineage - perhaps it was referencing an outdated version!? It ......
Read more >
keyerror in Python – How to Fix Dictionary Error
When working with dictionaries in Python, a KeyError gets raised when you try to access an item that doesn't exist in a Python...
Read more >
Python KeyError Exception Handling Examples - DigitalOcean
Avoiding KeyError when accessing Dictionary Key. We can avoid KeyError by using get() function to access the key value. If the key is...
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