lacuscore 1.7.6__py3-none-any.whl → 1.7.8__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.
- lacuscore/lacuscore.py +9 -6
- {lacuscore-1.7.6.dist-info → lacuscore-1.7.8.dist-info}/METADATA +2 -2
- lacuscore-1.7.8.dist-info/RECORD +8 -0
- lacuscore-1.7.6.dist-info/RECORD +0 -8
- {lacuscore-1.7.6.dist-info → lacuscore-1.7.8.dist-info}/LICENSE +0 -0
- {lacuscore-1.7.6.dist-info → lacuscore-1.7.8.dist-info}/WHEEL +0 -0
lacuscore/lacuscore.py
CHANGED
@@ -721,6 +721,9 @@ class LacusCore():
|
|
721
721
|
hash_to_set['cookies'] = pickle.dumps(results['cookies'])
|
722
722
|
if results.get('potential_favicons'):
|
723
723
|
hash_to_set['potential_favicons'] = pickle.dumps(results['potential_favicons'])
|
724
|
+
if results.get('html') and results['html'] is not None:
|
725
|
+
# Need to avoid unicode encore errors, and surrogates are not allowed
|
726
|
+
hash_to_set['html'] = results['html'].encode('utf-8', 'surrogateescape')
|
724
727
|
if 'children' in results and results['children'] is not None:
|
725
728
|
padding_length = len(str(len(results['children'])))
|
726
729
|
children = set()
|
@@ -735,7 +738,7 @@ class LacusCore():
|
|
735
738
|
hash_to_set['children'] = pickle.dumps(children)
|
736
739
|
|
737
740
|
for key in results.keys():
|
738
|
-
if key in ['har', 'cookies', 'potential_favicons', 'children'] or not results.get(key):
|
741
|
+
if key in ['har', 'cookies', 'potential_favicons', 'html', 'children'] or not results.get(key):
|
739
742
|
continue
|
740
743
|
# these entries can be stored directly
|
741
744
|
hash_to_set[key] = results[key] # type: ignore
|
@@ -795,11 +798,11 @@ class LacusCore():
|
|
795
798
|
capture_status = self.get_capture_status(uuid)
|
796
799
|
if capture_status == CaptureStatus.ONGOING:
|
797
800
|
# Check when it was started.
|
798
|
-
start_time
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
801
|
+
if start_time := self.redis.zscore('lacus:ongoing', uuid):
|
802
|
+
if start_time > time.time() - self.max_capture_time * 1.1:
|
803
|
+
# The capture started recently, wait before clearing it.
|
804
|
+
logger.warning('The capture is (probably) still going, not clearing.')
|
805
|
+
return
|
803
806
|
elif capture_status == CaptureStatus.QUEUED:
|
804
807
|
logger.warning('The capture is queued, not clearing.')
|
805
808
|
return
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lacuscore
|
3
|
-
Version: 1.7.
|
3
|
+
Version: 1.7.8
|
4
4
|
Summary: Core of Lacus, usable as a module
|
5
5
|
Home-page: https://github.com/ail-project/LacusCore
|
6
6
|
License: BSD-3-Clause
|
@@ -26,7 +26,7 @@ Provides-Extra: docs
|
|
26
26
|
Requires-Dist: Sphinx (<7.2) ; (python_version < "3.9") and (extra == "docs")
|
27
27
|
Requires-Dist: Sphinx (>=7.2,<8.0) ; (python_version >= "3.9") and (extra == "docs")
|
28
28
|
Requires-Dist: defang (>=0.5.3,<0.6.0)
|
29
|
-
Requires-Dist: playwrightcapture[recaptcha] (>=1.22.
|
29
|
+
Requires-Dist: playwrightcapture[recaptcha] (>=1.22.5,<2.0.0)
|
30
30
|
Requires-Dist: redis[hiredis] (>=5.0.1,<6.0.0)
|
31
31
|
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
32
32
|
Requires-Dist: ua-parser (>=0.18.0,<0.19.0)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
lacuscore/__init__.py,sha256=ytBrQRBXO1Q5yV72qyS16Q7Auqebl3EMhhLQUa0Sg4g,169
|
2
|
+
lacuscore/lacus_monitoring.py,sha256=3kbjz_ONjOXzaLzc8Vp7bUmEDKQDMi2uQgVSSfpqdXQ,2732
|
3
|
+
lacuscore/lacuscore.py,sha256=yZ6YfhpiGMjil_Gl7FsFOwrK6924RklBscVSyGvC3RM,39926
|
4
|
+
lacuscore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
+
lacuscore-1.7.8.dist-info/LICENSE,sha256=4C4hLYrIkUD96Ggk-y_Go1Qf7PBZrEm9PSeTGe2nd4s,1516
|
6
|
+
lacuscore-1.7.8.dist-info/METADATA,sha256=zW_QO9qtsDIN4lVw_lU4cL1cHOgtq5lUDpPGtAo1btk,2514
|
7
|
+
lacuscore-1.7.8.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
8
|
+
lacuscore-1.7.8.dist-info/RECORD,,
|
lacuscore-1.7.6.dist-info/RECORD
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
lacuscore/__init__.py,sha256=ytBrQRBXO1Q5yV72qyS16Q7Auqebl3EMhhLQUa0Sg4g,169
|
2
|
-
lacuscore/lacus_monitoring.py,sha256=3kbjz_ONjOXzaLzc8Vp7bUmEDKQDMi2uQgVSSfpqdXQ,2732
|
3
|
-
lacuscore/lacuscore.py,sha256=AIJBPDSEWL4tcMoHHuTiBxc98Hxv5NDq3siMSX2Ylzc,39666
|
4
|
-
lacuscore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
lacuscore-1.7.6.dist-info/LICENSE,sha256=4C4hLYrIkUD96Ggk-y_Go1Qf7PBZrEm9PSeTGe2nd4s,1516
|
6
|
-
lacuscore-1.7.6.dist-info/METADATA,sha256=qhd6JXfgqtJqN8pgHkYmttMHtlLGVYWulOS0lLITCFU,2514
|
7
|
-
lacuscore-1.7.6.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
8
|
-
lacuscore-1.7.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|