'Pytube - Traceback (most recent call last):
I have already uploaded the pytube library to the latest version (11.0.2).
This is my code: ...
from pytube import YouTube
video = YouTube(url="https://www.youtube.com/watch?v=xFrGuyw1V8s")
video_streams = video.streams.first()
video_streams.download()
... This is the output:
Traceback (most recent call last):
File "c:\Users\ostif\Documents\YT_downloader\yt_test.py", line 4, in
video_streams = video.streams.first()
File "C:\Users\ostif\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube_main_.py", line 292, in streams
return StreamQuery(self.fmt_streams)
File "C:\Users\ostif\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube_main_.py", line 177, in fmt_streams
extract.apply_signature(stream_manifest, self.vid_info, self.js)
File "C:\Users\ostif\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube\extract.py", line 409, in apply_signature
cipher = Cipher(js=js)
File "C:\Users\ostif\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube\cipher.py", line 43, in init
self.throttling_plan = get_throttling_plan(js)
File "C:\Users\ostif\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube\cipher.py", line 387, in get_throttling_plan
raw_code = get_throttling_function_code(js)
File "C:\Users\ostif\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pytube\cipher.py", line 301, in get_throttling_function_code
code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n')
AttributeError: 'NoneType' object has no attribute 'span'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
