Skip to content

Commit

Permalink
chg: allow no settings for auto_report
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Oct 20, 2023
1 parent 888644c commit a1a1a73
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 42 deletions.
16 changes: 16 additions & 0 deletions examples/autoreport.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pylookyloo import Lookyloo


# lookyloo_url = "https://lookyloo.circl.lu/"
# lookyloo_url = "https://lookyloo-demo.yoyodyne-it.eu/"
lookyloo_url = "http://0.0.0.0:5100"

lookyloo = Lookyloo(lookyloo_url)
capture_url = lookyloo.submit(url="https://circl.lu",
# auto_report=True)
auto_report={"email": "[email protected]",
"comment": "This is a phishing URL targeting my bank."})

print(capture_url)
70 changes: 35 additions & 35 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pylookyloo/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CaptureSettings(TypedDict, total=False):
referer: Optional[str]

listing: Optional[bool]
auto_report: Optional[Dict[str, str]]
auto_report: Optional[Union[bool, Dict[str, str]]]


class CompareSettings(TypedDict, total=False):
Expand Down Expand Up @@ -143,7 +143,7 @@ def submit(self, *, quiet: bool=False,
viewport: Optional[Dict[str, int]]=None,
referer: Optional[str]=None,
listing: Optional[bool]=None,
auto_report: Optional[Dict[str, str]]=None
auto_report: Optional[Union[bool, Dict[str, str]]]=None
) -> str:
...

Expand All @@ -165,7 +165,7 @@ def submit(self, *, quiet: bool=False,
viewport: Optional[Dict[str, int]]=None,
referer: Optional[str]=None,
listing: Optional[bool]=None,
auto_report: Optional[Dict[str, str]]=None
auto_report: Optional[Union[bool, Dict[str, str]]]=None
) -> str:
'''Submit a URL to a lookyloo instance.
Expand All @@ -192,7 +192,7 @@ def submit(self, *, quiet: bool=False,
:param referer: The referer URL for the capture
:param listing: If False, the capture will be not be on the publicly accessible index page of lookyloo
:param auto_report: If set, the capture will automatically be forwarded to an analyst (if the instance is configured this way)
Dictionary with two keys:
Pass True if you want to autoreport without any setting, or a dictionary with two keys:
* email (required): the email of the submitter, so the analyst to get in touch
* comment (optional): a comment about the capture to help the analyst
'''
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pylookyloo"
version = "1.22.0"
version = "1.22.1"
description = "Python CLI and module for Lookyloo"
authors = ["Raphaël Vinot <[email protected]>"]
license = "BSD-3-Clause"
Expand Down Expand Up @@ -39,8 +39,8 @@ Sphinx = [
]

[tool.poetry.group.dev.dependencies]
mypy = "^1.6.0"
types-requests = "^2.31.0.9"
mypy = "^1.6.1"
types-requests = "^2.31.0.10"
ipython = [
{version = "<8.13.0", python = "<3.9"},
{version = "^8.13.0", python = ">=3.9"}
Expand Down

0 comments on commit a1a1a73

Please sign in to comment.