From 05123dc4427c50ad8f8695ef7415bc5da9a3f031 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Fri, 22 Nov 2024 23:06:20 -0500 Subject: [PATCH] Fix invalid SSL context for theme downloads --- _src/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/_src/utils.py b/_src/utils.py index d84e0654..7d3a21e7 100644 --- a/_src/utils.py +++ b/_src/utils.py @@ -108,6 +108,7 @@ def mediafire_download(theme_url): re.search(r"mediafire\.com/file/.+?/(.+?)($|/file)", theme_url).group(1)) headers = {"User-Agent": "Mozilla/5.0"} ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) + ssl_context.set_alpn_protocols(["http/1.1"]) with urllib.request.urlopen(urllib.request.Request(theme_url, headers=headers), context=ssl_context) as fileobj: html = fileobj.read() soup = BeautifulSoup(html, "html.parser")