Guest User

Archive.is script

a guest
Feb 21st, 2016
923
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. Written in Python. Add links you want to archive in the list array.
  2.  
  3. import requests
  4. import re
  5. import sys
  6. import time
  7. import urllib
  8.  
  9. list = [
  10. 'https://runescape.com',
  11. 'https://google.com'
  12. ]
  13.  
  14. headers = {
  15. "Host": "archive.is",
  16. "Connection": "keep-alive",
  17. "Content-Length": "150",
  18. "Cache-Control": "max-age=0",
  19. "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
  20. "Origin": "http://archive.is",
  21. "Upgrade-Insecure-Requests": "1",
  22. "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36",
  23. "Content-Type": "application/x-www-form-urlencoded",
  24. "Referer": "http://archive.is/",
  25. "Accept-Encoding": "gzip, deflate",
  26. "Accept-Language": "en-US,en;q=0.8"
  27.  
  28. }
  29.  
  30. f = open('archivelinks.txt', 'r+')
  31.  
  32. submiturl = 'http://archive.is/submit/'
  33. submitid = 'dKcRmqFfNJ3YMmqus%2B8VHtMyZn8jImBpRzGaTfX6jknvpcyUWE1RyIqBMc8uJSO%2B'
  34.  
  35. for entry in list:
  36. payload = 'submitid=' + submitid + ' &url=' + urllib.parse.quote_plus(entry)
  37. r = requests.post(submiturl, data=payload, headers=headers)
  38. match = re.search("href=\"http://archive.is/(\w+)", str(r.text))
  39. if match and match.group(1):
  40. print('http://www.archive.is/' + match.group(1))
  41. f.write('http://www.archive.is/' + match.group(1) + '\n')
  42. time.sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment