Skip to content

Instantly share code, notes, and snippets.

@aoirint
Last active December 21, 2023 09:18
Show Gist options
  • Save aoirint/83a03af41e590bc40962d2c9f477fff1 to your computer and use it in GitHub Desktop.
Save aoirint/83a03af41e590bc40962d2c9f477fff1 to your computer and use it in GitHub Desktop.
from pathlib import Path
import httpx
import time
import logging
from logging import getLogger
logger = getLogger(__name__)
def main() -> None:
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(levelname)s %(name)s : %(message)s",
)
a = Path("a.txt").read_text(encoding="utf-8").strip().splitlines()
for url in a:
logger.info(url)
httpx.post(
"https://web.archive.org/save/" + url,
data={
"url": url,
"capture_all": "all",
},
headers={
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
},
)
time.sleep(60)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment