unrealon 1.1.1__py3-none-any.whl → 1.1.4__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.
Files changed (83) hide show
  1. unrealon/__init__.py +16 -6
  2. unrealon-1.1.4.dist-info/METADATA +658 -0
  3. unrealon-1.1.4.dist-info/RECORD +54 -0
  4. {unrealon-1.1.1.dist-info → unrealon-1.1.4.dist-info}/entry_points.txt +1 -1
  5. unrealon_browser/__init__.py +3 -6
  6. unrealon_browser/core/browser_manager.py +86 -84
  7. unrealon_browser/dto/models/config.py +2 -0
  8. unrealon_browser/managers/captcha.py +165 -185
  9. unrealon_browser/managers/cookies.py +57 -28
  10. unrealon_browser/managers/logger_bridge.py +94 -34
  11. unrealon_browser/managers/profile.py +186 -158
  12. unrealon_browser/managers/stealth.py +58 -47
  13. unrealon_driver/__init__.py +8 -21
  14. unrealon_driver/exceptions.py +5 -0
  15. unrealon_driver/html_analyzer/__init__.py +32 -0
  16. unrealon_driver/{parser/managers/html.py → html_analyzer/cleaner.py} +330 -405
  17. unrealon_driver/html_analyzer/config.py +64 -0
  18. unrealon_driver/html_analyzer/manager.py +247 -0
  19. unrealon_driver/html_analyzer/models.py +115 -0
  20. unrealon_driver/html_analyzer/websocket_analyzer.py +157 -0
  21. unrealon_driver/models/__init__.py +31 -0
  22. unrealon_driver/models/websocket.py +98 -0
  23. unrealon_driver/parser/__init__.py +4 -23
  24. unrealon_driver/parser/cli_manager.py +6 -5
  25. unrealon_driver/parser/daemon_manager.py +242 -66
  26. unrealon_driver/parser/managers/__init__.py +0 -21
  27. unrealon_driver/parser/managers/config.py +15 -3
  28. unrealon_driver/parser/parser_manager.py +225 -395
  29. unrealon_driver/smart_logging/__init__.py +24 -0
  30. unrealon_driver/smart_logging/models.py +44 -0
  31. unrealon_driver/smart_logging/smart_logger.py +406 -0
  32. unrealon_driver/smart_logging/unified_logger.py +525 -0
  33. unrealon_driver/websocket/__init__.py +31 -0
  34. unrealon_driver/websocket/client.py +249 -0
  35. unrealon_driver/websocket/config.py +188 -0
  36. unrealon_driver/websocket/manager.py +90 -0
  37. unrealon-1.1.1.dist-info/METADATA +0 -722
  38. unrealon-1.1.1.dist-info/RECORD +0 -82
  39. unrealon_bridge/__init__.py +0 -114
  40. unrealon_bridge/cli.py +0 -316
  41. unrealon_bridge/client/__init__.py +0 -93
  42. unrealon_bridge/client/base.py +0 -78
  43. unrealon_bridge/client/commands.py +0 -89
  44. unrealon_bridge/client/connection.py +0 -90
  45. unrealon_bridge/client/events.py +0 -65
  46. unrealon_bridge/client/health.py +0 -38
  47. unrealon_bridge/client/html_parser.py +0 -146
  48. unrealon_bridge/client/logging.py +0 -139
  49. unrealon_bridge/client/proxy.py +0 -70
  50. unrealon_bridge/client/scheduler.py +0 -450
  51. unrealon_bridge/client/session.py +0 -70
  52. unrealon_bridge/configs/__init__.py +0 -14
  53. unrealon_bridge/configs/bridge_config.py +0 -212
  54. unrealon_bridge/configs/bridge_config.yaml +0 -39
  55. unrealon_bridge/models/__init__.py +0 -138
  56. unrealon_bridge/models/base.py +0 -28
  57. unrealon_bridge/models/command.py +0 -41
  58. unrealon_bridge/models/events.py +0 -40
  59. unrealon_bridge/models/html_parser.py +0 -79
  60. unrealon_bridge/models/logging.py +0 -55
  61. unrealon_bridge/models/parser.py +0 -63
  62. unrealon_bridge/models/proxy.py +0 -41
  63. unrealon_bridge/models/requests.py +0 -95
  64. unrealon_bridge/models/responses.py +0 -88
  65. unrealon_bridge/models/scheduler.py +0 -592
  66. unrealon_bridge/models/session.py +0 -28
  67. unrealon_bridge/server/__init__.py +0 -91
  68. unrealon_bridge/server/base.py +0 -171
  69. unrealon_bridge/server/handlers/__init__.py +0 -23
  70. unrealon_bridge/server/handlers/command.py +0 -110
  71. unrealon_bridge/server/handlers/html_parser.py +0 -139
  72. unrealon_bridge/server/handlers/logging.py +0 -95
  73. unrealon_bridge/server/handlers/parser.py +0 -95
  74. unrealon_bridge/server/handlers/proxy.py +0 -75
  75. unrealon_bridge/server/handlers/scheduler.py +0 -545
  76. unrealon_bridge/server/handlers/session.py +0 -66
  77. unrealon_driver/browser/__init__.py +0 -8
  78. unrealon_driver/browser/config.py +0 -74
  79. unrealon_driver/browser/manager.py +0 -416
  80. unrealon_driver/parser/managers/browser.py +0 -51
  81. unrealon_driver/parser/managers/logging.py +0 -609
  82. {unrealon-1.1.1.dist-info → unrealon-1.1.4.dist-info}/WHEEL +0 -0
  83. {unrealon-1.1.1.dist-info → unrealon-1.1.4.dist-info}/licenses/LICENSE +0 -0
@@ -1,63 +0,0 @@
1
- """
2
- Parser-related models.
3
-
4
- Contains models for parser registration, information, and statistics.
5
- """
6
-
7
- from typing import List, Optional, Dict, Literal
8
- from datetime import datetime
9
- from pydantic import Field
10
- from typing_extensions import Annotated
11
-
12
- from .base import BaseParserModel
13
-
14
-
15
- class ParserInfo(BaseParserModel):
16
- """Parser registration and status information."""
17
-
18
- parser_id: Annotated[str, Field(min_length=1, description="Unique parser identifier")]
19
- parser_type: Annotated[str, Field(min_length=1, description="Type of parser (encar, autotrader, etc.)")]
20
- version: Annotated[str, Field(min_length=1, description="Parser version")]
21
- capabilities: List[str] = Field(default_factory=list, description="List of parser capabilities")
22
- status: Literal["active", "inactive", "error"] = "active"
23
- metadata: Dict[str, str] = Field(default_factory=dict, description="Additional parser metadata")
24
- registered_at: datetime = Field(default_factory=datetime.now)
25
- last_heartbeat: datetime = Field(default_factory=datetime.now)
26
-
27
-
28
- class ParserStats(BaseParserModel):
29
- """Parser performance and usage statistics."""
30
-
31
- parser_id: Annotated[str, Field(min_length=1, description="Parser ID")]
32
- total_commands: Annotated[int, Field(ge=0)] = 0
33
- successful_commands: Annotated[int, Field(ge=0)] = 0
34
- failed_commands: Annotated[int, Field(ge=0)] = 0
35
- average_response_time: Annotated[float, Field(ge=0)] = 0.0
36
- uptime_seconds: Annotated[int, Field(ge=0)] = 0
37
- memory_usage_mb: Annotated[float, Field(ge=0)] = 0.0
38
- cpu_usage_percent: Annotated[float, Field(ge=0, le=100)] = 0.0
39
- last_updated: datetime = Field(default_factory=datetime.now)
40
-
41
-
42
- class ParserHealth(BaseParserModel):
43
- """Parser health check information."""
44
-
45
- parser_id: Annotated[str, Field(min_length=1, description="Parser ID")]
46
- status: Literal["healthy", "degraded", "unhealthy"] = "healthy"
47
- last_check: datetime = Field(default_factory=datetime.now)
48
- response_time: Annotated[float, Field(ge=0)] = 0.0
49
- memory_usage: Annotated[float, Field(ge=0)] = 0.0
50
- cpu_usage: Annotated[float, Field(ge=0, le=100)] = 0.0
51
- active_connections: Annotated[int, Field(ge=0)] = 0
52
- queue_size: Annotated[int, Field(ge=0)] = 0
53
- errors: List[str] = Field(default_factory=list)
54
-
55
-
56
- class ParserSystemStats(BaseParserModel):
57
- """System-wide parser statistics."""
58
-
59
- total_parsers: Annotated[int, Field(ge=0)] = 0
60
- active_sessions: Annotated[int, Field(ge=0)] = 0
61
- total_commands: Annotated[int, Field(ge=0)] = 0
62
- allocated_proxies: Annotated[int, Field(ge=0)] = 0
63
- parser_types: Dict[str, int] = Field(default_factory=dict, description="Count by parser type")
@@ -1,41 +0,0 @@
1
- """
2
- Proxy-related models.
3
-
4
- Contains models for proxy allocation, management, and health checking.
5
- """
6
-
7
- from typing import Optional, Literal
8
- from datetime import datetime
9
- from pydantic import Field
10
- from typing_extensions import Annotated
11
-
12
- from .base import BaseParserModel
13
-
14
-
15
- class ProxyRequest(BaseParserModel):
16
- """Request for proxy allocation."""
17
-
18
- parser_id: Annotated[str, Field(min_length=1, description="Parser ID requesting proxy")]
19
- proxy_type: Literal["http", "https", "socks4", "socks5"] = "http"
20
- location: Optional[Annotated[str, Field(min_length=1, description="Preferred proxy location")]] = None
21
- session_duration: Annotated[int, Field(gt=0, le=86400, description="Session duration in seconds")] = 3600
22
- bandwidth_limit: Optional[Annotated[int, Field(gt=0, description="Bandwidth limit in MB/s")]] = None
23
-
24
-
25
- class ProxyInfo(BaseParserModel):
26
- """Proxy allocation information."""
27
-
28
- proxy_id: Annotated[str, Field(min_length=1, description="Unique proxy identifier")]
29
- parser_id: Annotated[str, Field(min_length=1, description="Parser ID using this proxy")]
30
- host: Annotated[str, Field(min_length=1, description="Proxy host")]
31
- port: Annotated[int, Field(gt=0, le=65535, description="Proxy port")]
32
- proxy_type: Literal["http", "https", "socks4", "socks5"] = "http"
33
- username: Optional[str] = None
34
- password: Optional[str] = None
35
- location: Optional[str] = None
36
- status: Literal["active", "inactive", "error"] = "active"
37
- allocated_at: datetime = Field(default_factory=datetime.now)
38
- expires_at: Optional[datetime] = None
39
- last_used: Optional[datetime] = None
40
- usage_count: Annotated[int, Field(ge=0)] = 0
41
- bandwidth_used: Annotated[float, Field(ge=0)] = 0.0
@@ -1,95 +0,0 @@
1
- """
2
- RPC request models.
3
-
4
- Strict typing for all RPC requests - NO Dict[str, Any] allowed!
5
- """
6
-
7
- from typing import Optional, Dict, List
8
- from pydantic import Field
9
-
10
- from .base import BaseRPCRequest
11
-
12
-
13
- class ParserRegisterRequest(BaseRPCRequest):
14
- """Request for parser registration."""
15
-
16
- parser_id: str = Field(description="Unique parser identifier")
17
- parser_type: str = Field(description="Type of parser")
18
- version: str = Field(description="Parser version")
19
- capabilities: List[str] = Field(default_factory=list, description="Parser capabilities")
20
- metadata: Optional[Dict[str, str]] = Field(default=None, description="Additional metadata")
21
-
22
-
23
- class ParserStatusRequest(BaseRPCRequest):
24
- """Request for parser status."""
25
-
26
- parser_id: str = Field(description="Parser ID to get status for")
27
-
28
-
29
- class ParserListRequest(BaseRPCRequest):
30
- """Request for parser list."""
31
-
32
- parser_type: Optional[str] = Field(default=None, description="Filter by parser type")
33
-
34
-
35
- class ParserHealthRequest(BaseRPCRequest):
36
- """Request for parser health check."""
37
-
38
- parser_id: str = Field(description="Parser ID to check health for")
39
-
40
-
41
- class SessionStartRequest(BaseRPCRequest):
42
- """Request for session start."""
43
-
44
- parser_id: str = Field(description="Parser ID")
45
- session_type: str = Field(description="Type of session")
46
- metadata: Optional[Dict[str, str]] = Field(default=None, description="Session metadata")
47
-
48
-
49
- class SessionEndRequest(BaseRPCRequest):
50
- """Request for session end."""
51
-
52
- session_id: str = Field(description="Session ID to end")
53
-
54
-
55
- class CommandExecuteRequest(BaseRPCRequest):
56
- """Request for command execution."""
57
-
58
- command_type: str = Field(description="Type of command")
59
- parser_id: str = Field(description="Parser ID")
60
- parameters: Dict[str, str] = Field(default_factory=dict, description="Command parameters")
61
- timeout: int = Field(default=300, description="Command timeout in seconds")
62
-
63
-
64
- class CommandCreateRequest(BaseRPCRequest):
65
- """Request for command creation."""
66
-
67
- command_type: str = Field(description="Type of command")
68
- parser_id: str = Field(description="Parser ID")
69
- parameters: Dict[str, str] = Field(default_factory=dict, description="Command parameters")
70
-
71
-
72
- class CommandStatusRequest(BaseRPCRequest):
73
- """Request for command status."""
74
-
75
- command_id: str = Field(description="Command ID to get status for")
76
-
77
-
78
- class ProxyAllocateRequest(BaseRPCRequest):
79
- """Request for proxy allocation."""
80
-
81
- parser_id: str = Field(description="Parser ID requesting proxy")
82
- proxy_type: str = Field(default="http", description="Type of proxy needed")
83
- location: Optional[str] = Field(default=None, description="Preferred proxy location")
84
-
85
-
86
- class ProxyReleaseRequest(BaseRPCRequest):
87
- """Request for proxy release."""
88
-
89
- proxy_id: str = Field(description="Proxy ID to release")
90
-
91
-
92
- class ProxyCheckRequest(BaseRPCRequest):
93
- """Request for proxy health check."""
94
-
95
- proxy_id: str = Field(description="Proxy ID to check")
@@ -1,88 +0,0 @@
1
- """
2
- RPC response models.
3
-
4
- Strict typing for all RPC responses - NO raw dicts allowed!
5
- """
6
-
7
- from typing import Optional, List
8
- from pydantic import Field
9
-
10
- from .base import BaseRPCResponse
11
- from .parser import ParserInfo, ParserHealth
12
- from .session import ParserSession
13
- from .command import ParserCommand, CommandResult
14
- from .proxy import ProxyInfo
15
-
16
-
17
- class ParserRegisterResponse(BaseRPCResponse):
18
- """Response for parser registration."""
19
-
20
- parser_id: Optional[str] = Field(default=None, description="Registered parser ID")
21
-
22
-
23
- class ParserStatusResponse(BaseRPCResponse):
24
- """Response for parser status request."""
25
-
26
- parser: Optional[ParserInfo] = Field(default=None, description="Parser information")
27
-
28
-
29
- class ParserListResponse(BaseRPCResponse):
30
- """Response for parser list request."""
31
-
32
- parsers: List[ParserInfo] = Field(default_factory=list, description="List of parsers")
33
- total: int = Field(default=0, description="Total number of parsers")
34
-
35
-
36
- class ParserHealthResponse(BaseRPCResponse):
37
- """Response for parser health check."""
38
-
39
- health: Optional[ParserHealth] = Field(default=None, description="Parser health information")
40
-
41
-
42
- class SessionStartResponse(BaseRPCResponse):
43
- """Response for session start."""
44
-
45
- session: Optional[ParserSession] = Field(default=None, description="Started session information")
46
-
47
-
48
- class SessionEndResponse(BaseRPCResponse):
49
- """Response for session end."""
50
-
51
- session_id: Optional[str] = Field(default=None, description="Ended session ID")
52
-
53
-
54
- class CommandExecuteResponse(BaseRPCResponse):
55
- """Response for command execution."""
56
-
57
- result: Optional[CommandResult] = Field(default=None, description="Command execution result")
58
-
59
-
60
- class CommandCreateResponse(BaseRPCResponse):
61
- """Response for command creation."""
62
-
63
- command: Optional[ParserCommand] = Field(default=None, description="Created command")
64
-
65
-
66
- class CommandStatusResponse(BaseRPCResponse):
67
- """Response for command status request."""
68
-
69
- command: Optional[ParserCommand] = Field(default=None, description="Command information")
70
-
71
-
72
- class ProxyAllocateResponse(BaseRPCResponse):
73
- """Response for proxy allocation."""
74
-
75
- proxy: Optional[ProxyInfo] = Field(default=None, description="Allocated proxy information")
76
-
77
-
78
- class ProxyReleaseResponse(BaseRPCResponse):
79
- """Response for proxy release."""
80
-
81
- proxy_id: Optional[str] = Field(default=None, description="Released proxy ID")
82
-
83
-
84
- class ProxyCheckResponse(BaseRPCResponse):
85
- """Response for proxy health check."""
86
-
87
- proxy_id: Optional[str] = Field(default=None, description="Checked proxy ID")
88
- status: Optional[str] = Field(default=None, description="Proxy status")