-
-
Save VictorWesterlund/0cd95a1c390dbce9546df79f670089fd to your computer and use it in GitHub Desktop.
Quick script to save URL to Wayback Machine with Python 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import sys, requests | |
# Usage: Pass URL to script, get back URL to Wayback Machine snapshot | |
base_url = 'http://web.archive.org' | |
try: | |
r = requests.get(f"{base_url}/save/{sys.argv[1]}") | |
r.raise_for_status() | |
except r.exceptions.RequestException as e: | |
raise SystemExit(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment