pytube: [BUG] 404 exception using pytube with Python 3.8.5
I am using the latest version pytube @ git+https://github.com/pytube/pytube@10989d2b7a5c1825958904638932c0a3d8147d71
Describe the bug I can create the YouTube object. However, when I try to access any of its properties an exception occurs.
To Reproduce This is the code that demonstrates the bug:
from pytube import YouTube yt = YouTube(‘https://youtu.be/2lAe1cqCOXo’) print(yt.title) print(yt.thumbnail_url)
Expected behavior I expect the title and thumbnail_url properties to be displayed. Instead I see an exception.
Output If pytube raises an exception, please provide the full traceback for the exception: Traceback (most recent call last): File “try_pytube.py”, line 3, in <module> print(yt.title) File “/usr/local/lib/python3.8/dist-packages/pytube/main.py”, line 366, in title self._title = self.player_response[‘videoDetails’][‘title’] File “/usr/local/lib/python3.8/dist-packages/pytube/main.py”, line 168, in player_response if isinstance(self.player_config_args[“player_response”], str): File “/usr/local/lib/python3.8/dist-packages/pytube/main.py”, line 188, in player_config_args self._player_config_args = self.vid_info File “/usr/local/lib/python3.8/dist-packages/pytube/main.py”, line 291, in vid_info return dict(parse_qsl(self.vid_info_raw)) File “/usr/local/lib/python3.8/dist-packages/pytube/main.py”, line 109, in vid_info_raw self._vid_info_raw = request.get(self.vid_info_url) File “/usr/local/lib/python3.8/dist-packages/pytube/request.py”, line 53, in get response = _execute_request(url, headers=extra_headers, timeout=timeout) File “/usr/local/lib/python3.8/dist-packages/pytube/request.py”, line 37, in _execute_request return urlopen(request, timeout=timeout) # nosec File “/usr/lib/python3.8/urllib/request.py”, line 222, in urlopen return opener.open(url, data, timeout) File “/usr/lib/python3.8/urllib/request.py”, line 531, in open response = meth(req, response) File “/usr/lib/python3.8/urllib/request.py”, line 640, in http_response response = self.parent.error( File “/usr/lib/python3.8/urllib/request.py”, line 569, in error return self._call_chain(*args) File “/usr/lib/python3.8/urllib/request.py”, line 502, in _call_chain result = func(*args) File “/usr/lib/python3.8/urllib/request.py”, line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not Found
System information Please provide the following information:
- Python version (run
python --version
): - Python 3.8.5
- Pytube version (run
print(pytube.__version__)
in python): - 10.9.3
- Command used to install pytube:
- python -m pip install git+https://github.com/pytube/pytube
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 23 (1 by maintainers)
Stop spamming “same” here please. This does not add anything of value but useless noise.
same issue
same issue with python 3.6
same issue here
same issue
can anybody tell me when it is going to fix…?
same issue here, anyone got a solution?
I am having the same exact issue, running on pytube 10.8.5 and Python 3.9.1. I recall this same issue cropping up about a month ago, the problem likely being a server-side change on YouTube’s end.
same issue
Also having this issue
same issue here
same issue~
same issue here…
Also getting same issue with python 3.8,.8
since yesterday i have same problem…