RedditVideoMakerBot
RedditVideoMakerBot copied to clipboard
Error when trying to download the background video
This is the error that I get when I try to run the program and it gets to the downloading the video.
╭──────────────────────────────────────────────────────────────────────────────╮
│ Getting AskReddit threads... │
╰──────────────────────────────────────────────────────────────────────────────╯
Video will be: What movie/tv show clearly didn’t research the subject it tackled? 👍
Received AskReddit threads Successfully.
╭──────────────────────────────────────────────────────────────────────────────────────────────╮
│ Saving Text to MP3 files 🎶 │
╰──────────────────────────────────────────────────────────────────────────────────────────────╯
Saving... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.1 it/s
Saved Text to MP3 files Successfully.
╭──────────────────────────────────────────────────────────────────────────────────────────────╮
│ Downloading Screenshots of Reddit Posts 📷 │
╰──────────────────────────────────────────────────────────────────────────────────────────────╯
Launching Headless Browser...
Downloading screenshots... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.3 it/s
Screenshots downloaded Successfully.
╭──────────────────────────────────────────────────────────────────────────────────────────────╮
│ We need to download the Minecraft background video. This is fairly large but it's only done │
│ once. 😎 │
╰──────────────────────────────────────────────────────────────────────────────────────────────╯
Downloading the background video... please be patient 🙏
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 1282, 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 1328, 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 1277, 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 1037, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 975, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1454, 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/alexjshepler/Desktop/RedditVideoMakerBot/main.py", line 20, in <module>
download_background()
File "/Users/alexjshepler/Desktop/RedditVideoMakerBot/video_creation/background.py", line 26, in download_background
YouTube("https://www.youtube.com/watch?v=n_Dv4JMiwK8").streams.filter(
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)>
You only need to download the background file once. This is a hacky soultion but it worked for me:
- use a youtube to mp4 website like this one (https://onlinevideoconverter.pro/en81/youtube-downloader-mp4)
- paste the youtube link into it (https://www.youtube.com/watch?v=n_Dv4JMiwK8)
- download in 720p
- rename the video to "background.mp4"
- create a new folder inside of "assets" called "mp4"
- drag the finished mp4 into the mp4 file
- enjoy! please lmk if you have any more issues.
Hi @alexjshepler
I hope you were able to resolve your issue as there has not been activity in this Issue, I will be closing this for the time being. Feel free to re-open the issue if it has not been solved!!
Happy Coding!