Skip to content

Commit

Permalink
Disabled SSL Verification for #41 and #35
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelGuardian authored Jan 30, 2019
1 parent 4f72ed1 commit 31dfa16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion getify.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from PIL import ImageDraw
from bs4 import BeautifulSoup
import uuid
import ssl

def find_between(file):
f = open(file, "r", encoding = "utf8")
Expand All @@ -18,6 +19,7 @@ def find_between(file):

"""Downloads web page from Wuxiaworld and saves it into the folder where the programm is located"""
def download(link, file_name):
context = ssl.SSLContext(ssl.CERT_NONE)
url = urllib.request.Request(
link,
data=None,
Expand All @@ -26,7 +28,7 @@ def download(link, file_name):
}
)

with urllib.request.urlopen(url) as response, open(file_name, 'wb') as out_file:
with urllib.request.urlopen(url, context=context) as response, open(file_name, 'wb') as out_file:
shutil.copyfileobj(response, out_file)


Expand Down

0 comments on commit 31dfa16

Please sign in to comment.