Demo example broken (KeyError: 'url_encoded_fmt_stream_map')
See original GitHub issueI’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:
- Created 4 years ago
- Reactions:14
- Comments:7 (1 by maintainers)
Top 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 >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
@jangroth @bigsandip fixed in my Python 3 only fork: https://github.com/hbmartin/pytube3
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.