Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1276, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1322, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1271, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1031, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 969, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1448, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 512, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1070, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1341, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/valentinopereira/Documents/practice/youtube/index.py", line 17, in <module>
download("https://www.youtube.com/watch?v=eFTLKWw542g")
File "/Users/valentinopereira/Documents/practice/youtube/index.py", line 7, in download
video = video.streams.get_highest_resolution()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytube/__main__.py", line 295, in streams
self.check_availability()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytube/__main__.py", line 210, in check_availability
status, messages = extract.playability_status(self.watch_html)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytube/__main__.py", line 102, in watch_html
self._watch_html = request.get(url=self.watch_url)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytube/request.py", line 53, in get
response = _execute_request(url, headers=extra_headers, timeout=timeout)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytube/request.py", line 37, in _execute_request
return urlopen(request, timeout=timeout) # nosec
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
I tried running it inside venv and even on my system python.
It's working but not on my local IDE (vs code). I have to use replit to run it so it is not downloading the file to my device.
Is there any way to run this on vscode ?
I don't know how but it is working.
Now I will make a tkinter gui to give this program an application like experience.
Do I have permission to use your code to make a gui ?
Yeah sure, you can go ahead.
If you also need me to collaborate, we can work on it together.
It's good to know you want to use something of mine, which is yours now 😅
I've had a good bit of fun messing around with pytube for various projects but it's been a while, I'll have to check it out again - thanks for the tutorial!
I need exactly something like this in PHP, I have searched the web for any library but found non, Can anyone provide me with access to YouTube music API thanks.
Hopefully I find my way around it when I gets it
We're a place where coders share, stay up-to-date and grow their careers.
Getting this error
I tried running it inside venv and even on my system python.
Update: Fixed it by doing these timonweb.com/python/fixing-certifi... and restarting terminal
Glad you fixed it!
It's working but not on my local IDE (vs code). I have to use replit to run it so it is not downloading the file to my device.
Is there any way to run this on vscode ?
Hello, thanks for reading!
It actually works on my IDE (VSCode)
I don't know how but it is working.
Now I will make a tkinter gui to give this program an application like experience.
Do I have permission to use your code to make a gui ?
Yeah sure, you can go ahead.
If you also need me to collaborate, we can work on it together.
It's good to know you want to use something of mine, which is yours now 😅
Already done, you can check it now
YTdownloader
This looks nice! 👍
Checking it out now
I've had a good bit of fun messing around with
pytubefor various projects but it's been a while, I'll have to check it out again - thanks for the tutorial!You are welcome!
The function calls in your main function are different than your definitions.
download_audiois meant to beYoutubeAudioDownloaddownloadis meant to beYoutubeVideoDownloadOpps, thanks for pointing this out!
I have edited the code 😃
Follow for more content like this :)
I also have a YouTube channel where I post video tutorials; feel free to check it out here:
youtube.com/channel/UCNhFxpk6hGt5u...
Thanks
Thanks for sharing! really helpful!
You are welcome 🤗
I need exactly something like this in PHP, I have searched the web for any library but found non, Can anyone provide me with access to YouTube music API thanks.
Hopefully I find my way around it when I gets it