Framawiki has uploaded a new change for review. (
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, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/53/358053/1
diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index c1618a5..34b563d 100755
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -221,13 +221,17 @@
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[:22] == 'http://web.archive.org':
+ archive = 'https://web.archive.org' + archive[22:]
+ return archive
def weblinksIn(text, withoutBracketed=False, onlyBracketed=False):
--
To view, visit https://gerrit.wikimedia.org/r/358053
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I26cfebe7c1a09a93dfe4be659226ecb08f9315d5
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Framawiki <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits