From db127a5c544087b7f6a68561a2dad9675a20899d Mon Sep 17 00:00:00 2001 From: akamhy <64683866+akamhy@users.noreply.github.com> Date: Wed, 6 May 2020 20:16:25 +0530 Subject: [PATCH] always return https --- waybackpy/wrapper.py | 2 ++ 1 file changed, 2 insertions(+) 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):