pylookyloo 1.25.0__py3-none-any.whl → 1.26.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pylookyloo might be problematic. Click here for more details.
- pylookyloo/api.py +29 -4
- {pylookyloo-1.25.0.dist-info → pylookyloo-1.26.1.dist-info}/METADATA +3 -2
- pylookyloo-1.26.1.dist-info/RECORD +8 -0
- pylookyloo-1.25.0.dist-info/RECORD +0 -8
- {pylookyloo-1.25.0.dist-info → pylookyloo-1.26.1.dist-info}/LICENSE +0 -0
- {pylookyloo-1.25.0.dist-info → pylookyloo-1.26.1.dist-info}/WHEEL +0 -0
- {pylookyloo-1.25.0.dist-info → pylookyloo-1.26.1.dist-info}/entry_points.txt +0 -0
pylookyloo/api.py
CHANGED
|
@@ -42,6 +42,7 @@ class CaptureSettings(TypedDict, total=False):
|
|
|
42
42
|
timezone_id: str | None
|
|
43
43
|
locale: str | None
|
|
44
44
|
color_scheme: str | None
|
|
45
|
+
java_script_enabled: bool
|
|
45
46
|
viewport: dict[str, int] | None
|
|
46
47
|
referer: str | None
|
|
47
48
|
|
|
@@ -147,6 +148,7 @@ class Lookyloo():
|
|
|
147
148
|
timezone_id: str | None=None,
|
|
148
149
|
locale: str | None=None,
|
|
149
150
|
color_scheme: str | None=None,
|
|
151
|
+
java_script_enabled: bool=True,
|
|
150
152
|
viewport: dict[str, int] | None=None,
|
|
151
153
|
referer: str | None=None,
|
|
152
154
|
listing: bool | None=None,
|
|
@@ -169,6 +171,7 @@ class Lookyloo():
|
|
|
169
171
|
timezone_id: str | None=None,
|
|
170
172
|
locale: str | None=None,
|
|
171
173
|
color_scheme: str | None=None,
|
|
174
|
+
java_script_enabled: bool | None=None,
|
|
172
175
|
viewport: dict[str, int] | None=None,
|
|
173
176
|
referer: str | None=None,
|
|
174
177
|
listing: bool | None=None,
|
|
@@ -195,6 +198,7 @@ class Lookyloo():
|
|
|
195
198
|
:param timezone_id: The timezone, warning, it m ust be a valid timezone (continent/city)
|
|
196
199
|
:param locale: The locale of the browser
|
|
197
200
|
:param color_scheme: The prefered color scheme of the browser (light or dark)
|
|
201
|
+
:param java_script_enabled: If False, no JS will run during the capture.
|
|
198
202
|
:param viewport: The viewport of the browser used for capturing
|
|
199
203
|
:param referer: The referer URL for the capture
|
|
200
204
|
:param listing: If False, the capture will be not be on the publicly accessible index page of lookyloo
|
|
@@ -246,6 +250,8 @@ class Lookyloo():
|
|
|
246
250
|
to_send['locale'] = locale
|
|
247
251
|
if color_scheme:
|
|
248
252
|
to_send['color_scheme'] = color_scheme
|
|
253
|
+
if java_script_enabled is not None:
|
|
254
|
+
to_send['java_script_enabled'] = java_script_enabled
|
|
249
255
|
if viewport:
|
|
250
256
|
to_send['viewport'] = viewport
|
|
251
257
|
if referer:
|
|
@@ -330,6 +336,13 @@ class Lookyloo():
|
|
|
330
336
|
r = self.session.post(urljoin(self.root_url, str(PurePosixPath('admin', tree_uuid, 'hide'))))
|
|
331
337
|
return r.json()
|
|
332
338
|
|
|
339
|
+
def remove_capture(self, tree_uuid: str) -> dict[str, str]:
|
|
340
|
+
'''Remove a capture, it will be impossible to get it by UUID (requires an authenticated user, use init_apikey first)'''
|
|
341
|
+
if not self.apikey:
|
|
342
|
+
raise AuthError('You need to initialize the apikey to use this method (see init_apikey)')
|
|
343
|
+
r = self.session.post(urljoin(self.root_url, str(PurePosixPath('admin', tree_uuid, 'remove'))))
|
|
344
|
+
return r.json()
|
|
345
|
+
|
|
333
346
|
def get_redirects(self, capture_uuid: str) -> dict[str, Any]:
|
|
334
347
|
'''Returns the initial redirects.
|
|
335
348
|
|
|
@@ -498,14 +511,26 @@ class Lookyloo():
|
|
|
498
511
|
def get_recent_captures(self, timestamp: str | datetime | float | None=None) -> list[str]:
|
|
499
512
|
'''Gets the uuids of the most recent captures
|
|
500
513
|
|
|
501
|
-
:param timestamp:
|
|
514
|
+
:param timestamp: Oldest timestamp to consider
|
|
502
515
|
'''
|
|
503
|
-
if
|
|
504
|
-
url = urljoin(self.root_url, str(PurePosixPath('json', 'recent_captures')))
|
|
505
|
-
else:
|
|
516
|
+
if timestamp:
|
|
506
517
|
if isinstance(timestamp, datetime):
|
|
507
518
|
timestamp = timestamp.timestamp()
|
|
508
519
|
url = urljoin(self.root_url, str(PurePosixPath('json', 'recent_captures', str(timestamp))))
|
|
520
|
+
else:
|
|
521
|
+
url = urljoin(self.root_url, str(PurePosixPath('json', 'recent_captures')))
|
|
522
|
+
r = self.session.get(url)
|
|
523
|
+
return r.json()
|
|
524
|
+
|
|
525
|
+
def get_categories_captures(self, category: str | None=None) -> list[str] | dict[str, list[str]] | None:
|
|
526
|
+
'''Get uuids for a specific category or all categorized uuids if category is None
|
|
527
|
+
|
|
528
|
+
:param category: The category according to which the uuids are to be returned
|
|
529
|
+
'''
|
|
530
|
+
if category:
|
|
531
|
+
url = urljoin(self.root_url, str(PurePosixPath('json', 'categories', category)))
|
|
532
|
+
else:
|
|
533
|
+
url = urljoin(self.root_url, str(PurePosixPath('json', 'categories')))
|
|
509
534
|
r = self.session.get(url)
|
|
510
535
|
return r.json()
|
|
511
536
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pylookyloo
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.26.1
|
|
4
4
|
Summary: Python CLI and module for Lookyloo
|
|
5
5
|
Home-page: https://github.com/lookyloo/PyLookyloo
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -24,7 +24,8 @@ Classifier: Topic :: Internet
|
|
|
24
24
|
Classifier: Topic :: Security
|
|
25
25
|
Provides-Extra: docs
|
|
26
26
|
Requires-Dist: Sphinx (<7.2) ; (python_version < "3.9") and (extra == "docs")
|
|
27
|
-
Requires-Dist: Sphinx (>=7.2,<8.0) ; (python_version >= "3.9") and (extra == "docs")
|
|
27
|
+
Requires-Dist: Sphinx (>=7.2,<8.0) ; (python_version >= "3.9" and python_version < "3.10") and (extra == "docs")
|
|
28
|
+
Requires-Dist: Sphinx (>=8,<9) ; (python_version >= "3.10") and (extra == "docs")
|
|
28
29
|
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
29
30
|
Project-URL: Documentation, https://pylookyloo.readthedocs.io/en/latest/
|
|
30
31
|
Project-URL: Repository, https://github.com/lookyloo/PyLookyloo
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
pylookyloo/__init__.py,sha256=_JYXwXHL7ShZkeruvGd8qDTpxNRfuDjvV65SOMMU6yc,1922
|
|
2
|
+
pylookyloo/api.py,sha256=2U7ExW9Cr7dJUOXXop_UIULR4Zru4SogC2Cu_wJ6OcM,28683
|
|
3
|
+
pylookyloo/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
pylookyloo-1.26.1.dist-info/LICENSE,sha256=4C4hLYrIkUD96Ggk-y_Go1Qf7PBZrEm9PSeTGe2nd4s,1516
|
|
5
|
+
pylookyloo-1.26.1.dist-info/METADATA,sha256=NwfOYpAMGHvhLk1kQzntIwKqR07HNrER1-0_SXzmGhY,2450
|
|
6
|
+
pylookyloo-1.26.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
7
|
+
pylookyloo-1.26.1.dist-info/entry_points.txt,sha256=y2c0Ujg8co6Xyf7MoxStVU-fLQMZBSGAg-KFidmsha4,44
|
|
8
|
+
pylookyloo-1.26.1.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
pylookyloo/__init__.py,sha256=_JYXwXHL7ShZkeruvGd8qDTpxNRfuDjvV65SOMMU6yc,1922
|
|
2
|
-
pylookyloo/api.py,sha256=YLMcYNZa9kE0U-3v569amCUtRKUWSGphHf1BPu4Zs1I,27335
|
|
3
|
-
pylookyloo/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
pylookyloo-1.25.0.dist-info/LICENSE,sha256=4C4hLYrIkUD96Ggk-y_Go1Qf7PBZrEm9PSeTGe2nd4s,1516
|
|
5
|
-
pylookyloo-1.25.0.dist-info/METADATA,sha256=GCazh6CEBrAsHOMVxlaZTx-alAU2H4YNSQUHrAIb5Qs,2340
|
|
6
|
-
pylookyloo-1.25.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
7
|
-
pylookyloo-1.25.0.dist-info/entry_points.txt,sha256=y2c0Ujg8co6Xyf7MoxStVU-fLQMZBSGAg-KFidmsha4,44
|
|
8
|
-
pylookyloo-1.25.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|