Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def cli(url, beginning, end, collapse, speed, limit, width, height, verbose, allow_redirects):
"""
Generate a GIF of a given website over a given time range.
"""
items = wayback.Wayback(url, limit, beginning, end, collapse).search()
if not os.path.exists(TMP_OUTPUT_DIR):
os.mkdir(TMP_OUTPUT_DIR)
# not sure how to correctly set this, trial and error...
with Pool(processes=12) as pool:
pool.starmap(capture_url, zip(items, repeat(width), repeat(height),
repeat(allow_redirects)))
output_fn = create_output_fn(url)
cmd = 'convert'
cmd += ' -delay {0}'.format(speed)
cmd += ' {0}'.format(os.path.join(TMP_OUTPUT_DIR, '*.png'))
if verbose:
cmd += ' -verbose'