lookyloo/client/pylookyloo/__init__.py

22 lines
729 B
Python
Raw Normal View History

2019-01-30 16:01:55 +01:00
from .api import Lookyloo
2020-03-16 17:18:06 +01:00
import argparse
def main():
parser = argparse.ArgumentParser(description='Enqueue a URL on Lookyloo.', epilog='The response is the permanent URL where you can see the result of the capture.')
parser.add_argument('--url', type=str, help='URL of the instance (defaults to https://lookyloo.circl.lu/, the public instance).')
parser.add_argument('--query', required=True, help='URL to enqueue.')
args = parser.parse_args()
if args.url:
lookyloo = Lookyloo(args.url)
else:
lookyloo = Lookyloo()
2020-03-17 15:13:52 +01:00
if lookyloo.is_up:
2020-03-16 17:18:06 +01:00
url = lookyloo.enqueue(args.query)
print(url)
else:
print(f'Unable to reach {lookyloo.root_url}. Is the server up?')