Open
Description
Hi,
when testing FingerprintGenerator I have seen that it can fail to generate fingerprints with error:
"ValueError: Cannot generate headers. User-Agent may be invalid, or screen constraints are too restrictive."
The problem is that this error can be thrown on "good" inputs that the generator previously successfully generated fingeprints for.
To reproduce, please start following stress test:
import pytest
from browserforge.fingerprints import Screen, FingerprintGenerator
@pytest.mark.parametrize("_", range(100))
def test_stress_fingerprint_generator_some_options(_) -> None:
"""Test that generator can work consistently."""
fingerprint = FingerprintGenerator().generate(
mock_webrtc = True,
screen=Screen(min_width=500.0, max_width=None, min_height=None, max_height=None),
strict=True)
assert fingerprint.mockWebRTC is True
assert fingerprint.screen.availWidth > 500
Metadata
Metadata
Assignees
Labels
No labels