-
Notifications
You must be signed in to change notification settings - Fork 5
/
waybackshotcli.py
18 lines (14 loc) · 1.31 KB
/
waybackshotcli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import argparse # parse system arguments
from waybackshot import WaybackShot # A simple API to retrieve screenshots of webpages stored on the Wayback Machine.
wayback_shot = WaybackShot()
parser = argparse.ArgumentParser(prog='wayback-shot', description='Get screenshot of archived urls in wayback machine by @sam5epi0l')
# setuping help & instructions to use.
parser.add_argument("-d", "--dateFrom", required=False, default=None, help='fetch archived urls after provided date (Format=YYYYMMDD)')
parser.add_argument("-o", "--outputDIR", required=False, default="", help='save screenshot output to directory (default="")')
parser.add_argument("-w", "--width", required=False, default=1920, help='Width of the webpage used to screenshot (default=1920)')
parser.add_argument("-r", "--replace", required=False, default=False, help='replace existing screenshot of the URL', action='store_true')
parser.add_argument("-i", "--includeDate", required=False, default=False, help='fetch Date when the URL was archived', action='store_true')
parser.add_argument("-u", "--url", required=True, help='perform screenshot on the provided URL')
args = parser.parse_args()
# Takes screenshot of URLs
wayback_shot.screenshot(url=args.url, date=args.dateFrom, dir=args.outputDIR, width=args.width, overwrite=args.replace, include_date=args.includeDate)