Skip to content

Commit

Permalink
Fix invalid SSL context for theme downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
t1m0thyj committed Nov 23, 2024
1 parent 8308280 commit 05123dc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions _src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 05123dc

Please sign in to comment.