Skip to content

Commit 6ca8c36

Browse files
authored
Merge pull request #160 from frostyyyy1/main
fix for le ssl doing a poopy
2 parents 1ea7900 + 158e07b commit 6ca8c36

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Source/assets/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
import functools
88
import os
99
import shutil
10+
import ssl
1011

1112
# Internal or local application imports
1213
import util.const
1314
from . import material, queue, returns, serialisers, extractor, thumbnail
1415

16+
ssl._create_default_https_context = ssl._create_unverified_context
17+
1518

1619
@dataclasses.dataclass
1720
class asset_redirect:

Source/pretasks/download.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import shutil
55
import io
66
import os
7+
import ssl
78

89
# Third-party imports
910
import tqdm_vendored as tqdm
@@ -28,7 +29,8 @@ def get_remote_link(
2829

2930

3031
def download(remote_link: str, quiet: bool = False) -> io.BytesIO:
31-
with urllib.request.urlopen(remote_link) as response:
32+
ctx = ssl._create_unverified_context()
33+
with urllib.request.urlopen(remote_link, context=ctx) as response:
3234
if response.status != 200:
3335
raise Exception(
3436
"Failed to download: HTTP Status %d" %

0 commit comments

Comments
 (0)