Here's my code I keep get an error but I don't what and why the error is there
from pytube import YouTube
from tkinter import *
from tkinter import Tk, font
root = Tk()
root.geometry('700x250')
root.title('YouTube Downloader')
link_here = Label(root, text="Paste Here", font=("courier",40,))
link_here.place(x=220,y=40)
linkbruh = StringVar()
pasted = Entry(root,width=60,textvariable=linkbruh)
pasted.place(x=80,y=120)
def download():
a = (str(linkbruh.get()))
vid = YouTube(a).streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first()
vid.download('/downloadhere')
Button(root,text="Download Video", width=20, bg="black", fg="gray", command=download).place(x=250,y=170)
root.mainloop()
Thats my code and when I tried to paste the link of a YouTube vid, it would just give an error message saying
Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1350, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1240, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1286, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1235, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1006, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 946, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1409, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/tkinter/__init__.py", line 1883, in __call__
return self.func(*args)
File "/Users/dylanbradley/PycharmProjects/ytconvert/main.py", line 18, in download
vid = YouTube(a).streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first()
File "/Users/dylanbradley/PycharmProjects/ytconvert/venv/lib/python3.8/site-packages/pytube/__main__.py", line 91, in __init__
self.prefetch()
File "/Users/dylanbradley/PycharmProjects/ytconvert/venv/lib/python3.8/site-packages/pytube/__main__.py", line 162, in prefetch
self.watch_html = request.get(url=self.watch_url)
File "/Users/dylanbradley/PycharmProjects/ytconvert/venv/lib/python3.8/site-packages/pytube/request.py", line 36, in get
return _execute_request(url).read().decode("utf-8")
File "/Users/dylanbradley/PycharmProjects/ytconvert/venv/lib/python3.8/site-packages/pytube/request.py", line 24, in _execute_request
return urlopen(request) # nosec
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1393, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1353, 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:1123)>
I'm fairly new and I'm so confused, if you could help me that would be very appreciated because I do not understand what this means