You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
Expected no exception to be raised.
Output
Traceback (most recent call last):
File "/home/runner/work/thepipe/thepipe/tests/test_thepipe.py", line 51, in test_extract_youtube
chunks = extractor.extract_from_source("https://www.youtube.com/watch?v=wUEr7TayrmU")
File "/home/runner/work/thepipe/thepipe/thepipe_api/extractor.py", line 55, in extract_from_source
return extract_youtube(youtube_url=source, text_only=text_only, verbose=verbose)
File "/home/runner/work/thepipe/thepipe/thepipe_api/extractor.py", line 376, in extract_youtube
stream.download(temp_dir, filename=filename)
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/pytube/streams.py", line 309, in download
bytes_remaining = self.filesize
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/pytube/streams.py", line 157, in filesize
self._filesize = request.filesize(self.url)
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/pytube/request.py", line 204, in filesize
return int(head(url)["content-length"])
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/pytube/request.py", line 268, in head
response_headers = _execute_request(url, method="HEAD").info()
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/pytube/request.py", line 37, in _execute_request
return urlopen(request, timeout=timeout) # nosec
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/urllib/request.py", line 525, in open
response = meth(req, response)
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/urllib/request.py", line 634, in http_response
response = self.parent.error(
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/urllib/request.py", line 563, in error
return self._call_chain(*args)
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/urllib/request.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
System information
Default github actions server
EDIT: It seems this same error prompted the creation of a similar issue which may be resolved by setting a User-Agent in the request header.
The text was updated successfully, but these errors were encountered:
Experienced this error a while back. After a few days everything was working normally. After my research i came to the conclusion that this is a restriction by youtube on your ip address or device they will eventually lift it
Experienced this error a while back. After a few days everything was working normally. After my research i came to the conclusion that this is a restriction by youtube on your ip address or device they will eventually lift it
Coming back here to say that I've had pretty much the same experience.
I am on the latest version of pytube.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Please provide the following information:
Expected behavior
Expected no exception to be raised.
Output
System information
Default github actions server
EDIT: It seems this same error prompted the creation of a similar issue which may be resolved by setting a User-Agent in the request header.
The text was updated successfully, but these errors were encountered: