diff --git a/waybackpy/wrapper.py b/waybackpy/wrapper.py index 2cf2256..cde0d80 100644 --- a/waybackpy/wrapper.py +++ b/waybackpy/wrapper.py @@ -97,6 +97,8 @@ def near( raise ArchiveNotFound("'%s' is not yet archived." % url) archive_url = (data["archived_snapshots"]["closest"]["url"]) + # wayback machine returns http sometimes, idk why? But they support https + archive_url = archive_url.replace("http://web.archive.org/web/","https://web.archive.org/web/",1) return archive_url def oldest(url,UA=default_UA,year=1994):