Update wrapper.py
This commit is contained in:
parent
69f265ccff
commit
af1ac96d48
@ -44,8 +44,10 @@ def near(
|
|||||||
UA="pywayback python module",
|
UA="pywayback python module",
|
||||||
):
|
):
|
||||||
timestamp = str(year)+str(month)+str(day)+str(hour)+str(minute)
|
timestamp = str(year)+str(month)+str(day)+str(hour)+str(minute)
|
||||||
Rurl = "https://archive.org/wayback/available?url=%s×tamp=%s" % (str(url), str(timestamp))
|
request_url = "https://archive.org/wayback/available?url=%s×tamp=%s" % (str(url), str(timestamp))
|
||||||
response = urlopen(Rurl) #nosec
|
hdr = { 'User-Agent' : '%s' % UA }
|
||||||
|
req = Request(request_url, headers=hdr)
|
||||||
|
response = urlopen(req) #nosec
|
||||||
encoding = response.info().get_content_charset('utf8')
|
encoding = response.info().get_content_charset('utf8')
|
||||||
import json
|
import json
|
||||||
data = json.loads(response.read().decode(encoding))
|
data = json.loads(response.read().decode(encoding))
|
||||||
|
Loading…
Reference in New Issue
Block a user