From 7daa7f8e5a20d7e1ea5b26f46fbd178f0c893466 Mon Sep 17 00:00:00 2001 From: will Date: Tue, 13 Sep 2022 16:26:11 +0800 Subject: [PATCH] fix SSL error --- gl3w_gen.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gl3w_gen.py b/gl3w_gen.py index 27bfb6c..9f6c643 100755 --- a/gl3w_gen.py +++ b/gl3w_gen.py @@ -31,6 +31,7 @@ import argparse import os import re +import ssl # Try to import Python 3 library urllib.request # and if it fails, fall back to Python 2 urllib2 @@ -87,6 +88,8 @@ def download(url, dst): print('Reusing {0}...'.format(dst)) return + ssl._create_default_https_context = ssl._create_unverified_context + print('Downloading {0}...'.format(dst)) web = urllib2.urlopen(urllib2.Request(url, headers={'User-Agent': 'Mozilla/5.0'})) with open(dst, 'wb') as f: