Pytube: KeyError: 'url_encoded_fmt_stream_map'

Created on 25 Dec 2019  路  5Comments  路  Source: pytube/pytube

import pytube

link = 'https://youtu.be/WvISLQMd8BM'

save_path = 'c:Temp'
pytube.YouTube(link).streams.first().download(save_path)

Windows 10 and Python 3.7

Traceback (most recent call last):
File "C:/MyWork/PythonEdu/_DownloadTube/Issue.py", line 7, in
pytube.YouTube(link).streams.first().download(save_path)
File "C:UsersIngeneerAppDataLocalProgramsPythonPython37libsite-packagespytube__main__.py", line 88, in __init__
self.prefetch_init()
File "C:UsersIngeneerAppDataLocalProgramsPythonPython37libsite-packagespytube__main__.py", line 97, in prefetch_init
self.init()
File "C:UsersIngeneerAppDataLocalProgramsPythonPython37libsite-packagespytube__main__.py", line 143, in init
mixins.apply_descrambler(self.player_config_args, fmt)
File "C:UsersIngeneerAppDataLocalProgramsPythonPython37libsite-packagespytubemixins.py", line 96, in apply_descrambler
for i in stream_data[key].split(',')
KeyError: 'url_encoded_fmt_stream_map'

stale

Most helpful comment

I am getting the same error on Ubuntu 18 Python 3.7

Python 3.7.5 (default, Nov  7 2019, 10:50:52) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pytube import YouTube
>>> yt = YouTube('http://youtube.com/watch?v=B0CuLzsivzA')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/pytube/pytube/__main__.py", line 88, in __init__
    self.prefetch_init()
  File "/opt/pytube/pytube/__main__.py", line 97, in prefetch_init
    self.init()
  File "/opt/pytube/pytube/__main__.py", line 143, in init
    mixins.apply_descrambler(self.player_config_args, fmt)
  File "/opt/pytube/pytube/mixins.py", line 96, in apply_descrambler
    for i in stream_data[key].split(',')
KeyError: 'url_encoded_fmt_stream_map'

All 5 comments

Fixed, #537

I am getting the same error on Ubuntu 18 Python 3.7

Python 3.7.5 (default, Nov  7 2019, 10:50:52) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pytube import YouTube
>>> yt = YouTube('http://youtube.com/watch?v=B0CuLzsivzA')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/pytube/pytube/__main__.py", line 88, in __init__
    self.prefetch_init()
  File "/opt/pytube/pytube/__main__.py", line 97, in prefetch_init
    self.init()
  File "/opt/pytube/pytube/__main__.py", line 143, in init
    mixins.apply_descrambler(self.player_config_args, fmt)
  File "/opt/pytube/pytube/mixins.py", line 96, in apply_descrambler
    for i in stream_data[key].split(',')
KeyError: 'url_encoded_fmt_stream_map'

@rosin55 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ajayrandhawa picture ajayrandhawa  路  20Comments

Ircama picture Ircama  路  32Comments

Ikebani picture Ikebani  路  36Comments

stdedos picture stdedos  路  24Comments

stephanemombuleau picture stephanemombuleau  路  19Comments