Update wrapper.py

This commit is contained in:
akamhy 2020-05-05 10:00:29 +05:30 committed by GitHub
parent 7d434c3f0f
commit 8acb14a243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ def save(url,UA=default_UA):
def get(url,encoding=None,UA=default_UA): def get(url,encoding=None,UA=default_UA):
hdr = { 'User-Agent' : '%s' % UA } hdr = { 'User-Agent' : '%s' % UA }
request_url = clean_url(url) request_url = clean_url(url)
req = Request(request_url, headers=hdr) req = Request(request_url, headers=hdr) #nosec
resp=urlopen(req) #nosec resp=urlopen(req) #nosec
if encoding is None: if encoding is None:
try: try:
@ -77,7 +77,7 @@ def near(
data = json.loads(response.read().decode("UTF-8")) data = json.loads(response.read().decode("UTF-8"))
if not data["archived_snapshots"]: if not data["archived_snapshots"]:
raise ArchiveNotFound("'%s' is not yet archived." % url) raise ArchiveNotFound("'%s' is not yet archived." % url)
archive_url = (data["archived_snapshots"]["closest"]["url"]) archive_url = (data["archived_snapshots"]["closest"]["url"])
return archive_url return archive_url