Update wrapper.py

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

View File

@ -17,8 +17,8 @@ def clean_url(url):
def save(url,UA=default_UA): def save(url,UA=default_UA):
base_save_url = "https://web.archive.org/save/" base_save_url = "https://web.archive.org/save/"
request_url = (base_save_url + clean_url(url)) request_url = (base_save_url + clean_url(url))
hdr = { 'User-Agent' : '%s' % UA } hdr = { 'User-Agent' : '%s' % UA } #nosec
req = Request(request_url, headers=hdr) req = Request(request_url, headers=hdr) #nosec
if "." not in url: if "." not in url:
raise InvalidUrl("'%s' is not a vaild url." % url) raise InvalidUrl("'%s' is not a vaild url." % url)
try: try: