jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/358053 )
Change subject: [bugfix] weblinkchecker.py: Use https for web.archive.org ......................................................................
[bugfix] weblinkchecker.py: Use https for web.archive.org
It's a temporary patch until the bug waiting for this bug to be fixed by memento_client library
Bug: T167463 Change-Id: I26cfebe7c1a09a93dfe4be659226ecb08f9315d5 --- M scripts/weblinkchecker.py 1 file changed, 7 insertions(+), 2 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py index c1618a5..61cc065 100755 --- a/scripts/weblinkchecker.py +++ b/scripts/weblinkchecker.py @@ -221,14 +221,19 @@ def get_archive_url(url): """Get archive URL.""" try: - return _get_closest_memento_url( + archive = _get_closest_memento_url( url, timegate_uri='http://web.archive.org/web/') except Exception: - return _get_closest_memento_url( + archive = _get_closest_memento_url( url, timegate_uri='http://timetravel.mementoweb.org/webcite/timegate/')
+ # FIXME: Hack for T167463: Use https instead of http for archive.org links + if archive.startswith('http://web.archive.org'): + archive = archive.replace('http://', 'https://', 1) + return archive +
def weblinksIn(text, withoutBracketed=False, onlyBracketed=False): """
pywikibot-commits@lists.wikimedia.org