-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsession.py
More file actions
86 lines (57 loc) · 2.78 KB
/
session.py
File metadata and controls
86 lines (57 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
from datetime import datetime
from typing_extensions import Literal
from pydantic import Field as FieldInfo
from .._models import BaseModel
__all__ = ["Session", "Dimensions", "StealthConfig"]
class Dimensions(BaseModel):
height: int
"""Height of the browser window"""
width: int
"""Width of the browser window"""
class StealthConfig(BaseModel):
humanize_interactions: Optional[bool] = FieldInfo(alias="humanizeInteractions", default=None)
"""
This flag will make the browser act more human-like by moving the mouse in a
more natural way
"""
skip_fingerprint_injection: Optional[bool] = FieldInfo(alias="skipFingerprintInjection", default=None)
"""This flag will skip the fingerprint generation for the session."""
class Session(BaseModel):
id: str
"""Unique identifier for the session"""
created_at: datetime = FieldInfo(alias="createdAt")
"""Timestamp when the session started"""
credits_used: int = FieldInfo(alias="creditsUsed")
"""Amount of credits consumed by the session"""
debug_url: str = FieldInfo(alias="debugUrl")
"""URL for debugging the session"""
dimensions: Dimensions
"""Viewport and browser window dimensions for the session"""
duration: int
"""Duration of the session in milliseconds"""
event_count: int = FieldInfo(alias="eventCount")
"""Number of events processed in the session"""
proxy_bytes_used: int = FieldInfo(alias="proxyBytesUsed")
"""Amount of data transmitted through the proxy"""
proxy_source: Optional[Literal["steel", "external"]] = FieldInfo(alias="proxySource", default=None)
"""Source of the proxy used for the session"""
session_viewer_url: str = FieldInfo(alias="sessionViewerUrl")
"""URL to view session details"""
status: Literal["live", "released", "failed"]
"""Status of the session"""
timeout: int
"""Session timeout duration in milliseconds"""
websocket_url: str = FieldInfo(alias="websocketUrl")
"""URL for the session's WebSocket connection"""
is_selenium: Optional[bool] = FieldInfo(alias="isSelenium", default=None)
"""Indicates if Selenium is used in the session"""
region: Optional[Literal["lax", "ord", "iad", "bom", "scl", "fra", "hkg"]] = None
"""The region where the session was created"""
solve_captcha: Optional[bool] = FieldInfo(alias="solveCaptcha", default=None)
"""Indicates if captcha solving is enabled"""
stealth_config: Optional[StealthConfig] = FieldInfo(alias="stealthConfig", default=None)
"""Stealth configuration for the session"""
user_agent: Optional[str] = FieldInfo(alias="userAgent", default=None)
"""User agent string used in the session"""