unrealon 1.1.6__py3-none-any.whl → 2.0.5__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.
- {unrealon-1.1.6.dist-info/licenses → unrealon-2.0.5.dist-info}/LICENSE +1 -1
- unrealon-2.0.5.dist-info/METADATA +491 -0
- unrealon-2.0.5.dist-info/RECORD +128 -0
- {unrealon-1.1.6.dist-info → unrealon-2.0.5.dist-info}/WHEEL +2 -1
- unrealon-2.0.5.dist-info/entry_points.txt +3 -0
- unrealon-2.0.5.dist-info/top_level.txt +3 -0
- unrealon_browser/__init__.py +5 -6
- unrealon_browser/cli/browser_cli.py +18 -9
- unrealon_browser/cli/interactive_mode.py +13 -4
- unrealon_browser/core/browser_manager.py +29 -16
- unrealon_browser/dto/__init__.py +21 -0
- unrealon_browser/dto/bot_detection.py +175 -0
- unrealon_browser/dto/models/config.py +9 -3
- unrealon_browser/managers/__init__.py +1 -1
- unrealon_browser/managers/logger_bridge.py +1 -4
- unrealon_browser/stealth/__init__.py +27 -0
- unrealon_browser/stealth/bypass_techniques.pyc +0 -0
- unrealon_browser/stealth/manager.pyc +0 -0
- unrealon_browser/stealth/nodriver_stealth.pyc +0 -0
- unrealon_browser/stealth/playwright_stealth.pyc +0 -0
- unrealon_browser/stealth/scanner_tester.pyc +0 -0
- unrealon_browser/stealth/undetected_chrome.pyc +0 -0
- unrealon_core/__init__.py +172 -0
- unrealon_core/config/__init__.py +16 -0
- unrealon_core/config/environment.py +151 -0
- unrealon_core/config/urls.py +94 -0
- unrealon_core/enums/__init__.py +24 -0
- unrealon_core/enums/status.py +216 -0
- unrealon_core/enums/types.py +240 -0
- unrealon_core/error_handling/__init__.py +45 -0
- unrealon_core/error_handling/circuit_breaker.py +292 -0
- unrealon_core/error_handling/error_context.py +324 -0
- unrealon_core/error_handling/recovery.py +371 -0
- unrealon_core/error_handling/retry.py +268 -0
- unrealon_core/exceptions/__init__.py +46 -0
- unrealon_core/exceptions/base.py +292 -0
- unrealon_core/exceptions/communication.py +22 -0
- unrealon_core/exceptions/driver.py +11 -0
- unrealon_core/exceptions/proxy.py +11 -0
- unrealon_core/exceptions/task.py +12 -0
- unrealon_core/exceptions/validation.py +17 -0
- unrealon_core/models/__init__.py +79 -0
- unrealon_core/models/arq_context.py +252 -0
- unrealon_core/models/arq_responses.py +125 -0
- unrealon_core/models/base.py +291 -0
- unrealon_core/models/bridge_stats.py +58 -0
- unrealon_core/models/communication.py +39 -0
- unrealon_core/models/connection_stats.py +47 -0
- unrealon_core/models/driver.py +30 -0
- unrealon_core/models/driver_details.py +98 -0
- unrealon_core/models/logging.py +28 -0
- unrealon_core/models/task.py +21 -0
- unrealon_core/models/typed_responses.py +210 -0
- unrealon_core/models/websocket/__init__.py +91 -0
- unrealon_core/models/websocket/base.py +49 -0
- unrealon_core/models/websocket/config.py +200 -0
- unrealon_core/models/websocket/driver.py +215 -0
- unrealon_core/models/websocket/errors.py +138 -0
- unrealon_core/models/websocket/heartbeat.py +100 -0
- unrealon_core/models/websocket/logging.py +261 -0
- unrealon_core/models/websocket/proxy.py +496 -0
- unrealon_core/models/websocket/tasks.py +275 -0
- unrealon_core/models/websocket/utils.py +153 -0
- unrealon_core/models/websocket_session.py +144 -0
- unrealon_core/monitoring/__init__.py +43 -0
- unrealon_core/monitoring/alerts.py +398 -0
- unrealon_core/monitoring/dashboard.py +307 -0
- unrealon_core/monitoring/health_check.py +354 -0
- unrealon_core/monitoring/metrics.py +352 -0
- unrealon_core/utils/__init__.py +11 -0
- unrealon_core/utils/time.py +61 -0
- unrealon_core/version.py +219 -0
- unrealon_driver/__init__.py +90 -51
- unrealon_driver/core_module/__init__.py +34 -0
- unrealon_driver/core_module/base.py +184 -0
- unrealon_driver/core_module/config.py +30 -0
- unrealon_driver/core_module/event_manager.py +127 -0
- unrealon_driver/core_module/protocols.py +98 -0
- unrealon_driver/core_module/registry.py +146 -0
- unrealon_driver/decorators/__init__.py +15 -0
- unrealon_driver/decorators/retry.py +117 -0
- unrealon_driver/decorators/schedule.py +137 -0
- unrealon_driver/decorators/task.py +61 -0
- unrealon_driver/decorators/timing.py +132 -0
- unrealon_driver/driver/__init__.py +20 -0
- unrealon_driver/driver/communication/__init__.py +10 -0
- unrealon_driver/driver/communication/session.py +203 -0
- unrealon_driver/driver/communication/websocket_client.py +205 -0
- unrealon_driver/driver/core/__init__.py +10 -0
- unrealon_driver/driver/core/config.py +175 -0
- unrealon_driver/driver/core/driver.py +221 -0
- unrealon_driver/driver/factory/__init__.py +9 -0
- unrealon_driver/driver/factory/manager_factory.py +130 -0
- unrealon_driver/driver/lifecycle/__init__.py +11 -0
- unrealon_driver/driver/lifecycle/daemon.py +76 -0
- unrealon_driver/driver/lifecycle/initialization.py +97 -0
- unrealon_driver/driver/lifecycle/shutdown.py +48 -0
- unrealon_driver/driver/monitoring/__init__.py +9 -0
- unrealon_driver/driver/monitoring/health.py +63 -0
- unrealon_driver/driver/utilities/__init__.py +10 -0
- unrealon_driver/driver/utilities/logging.py +51 -0
- unrealon_driver/driver/utilities/serialization.py +61 -0
- unrealon_driver/managers/__init__.py +32 -0
- unrealon_driver/managers/base.py +174 -0
- unrealon_driver/managers/browser.py +98 -0
- unrealon_driver/managers/cache.py +116 -0
- unrealon_driver/managers/http.py +107 -0
- unrealon_driver/managers/logger.py +286 -0
- unrealon_driver/managers/proxy.py +99 -0
- unrealon_driver/managers/registry.py +87 -0
- unrealon_driver/managers/threading.py +54 -0
- unrealon_driver/managers/update.py +107 -0
- unrealon_driver/utils/__init__.py +9 -0
- unrealon_driver/utils/time.py +10 -0
- unrealon-1.1.6.dist-info/METADATA +0 -625
- unrealon-1.1.6.dist-info/RECORD +0 -55
- unrealon-1.1.6.dist-info/entry_points.txt +0 -9
- unrealon_browser/managers/stealth.py +0 -388
- unrealon_driver/README.md +0 -0
- unrealon_driver/exceptions.py +0 -33
- unrealon_driver/html_analyzer/__init__.py +0 -32
- unrealon_driver/html_analyzer/cleaner.py +0 -657
- unrealon_driver/html_analyzer/config.py +0 -64
- unrealon_driver/html_analyzer/manager.py +0 -247
- unrealon_driver/html_analyzer/models.py +0 -115
- unrealon_driver/html_analyzer/websocket_analyzer.py +0 -157
- unrealon_driver/models/__init__.py +0 -31
- unrealon_driver/models/websocket.py +0 -98
- unrealon_driver/parser/__init__.py +0 -36
- unrealon_driver/parser/cli_manager.py +0 -142
- unrealon_driver/parser/daemon_manager.py +0 -403
- unrealon_driver/parser/managers/__init__.py +0 -25
- unrealon_driver/parser/managers/config.py +0 -293
- unrealon_driver/parser/managers/error.py +0 -412
- unrealon_driver/parser/managers/result.py +0 -321
- unrealon_driver/parser/parser_manager.py +0 -458
- unrealon_driver/smart_logging/__init__.py +0 -24
- unrealon_driver/smart_logging/models.py +0 -44
- unrealon_driver/smart_logging/smart_logger.py +0 -406
- unrealon_driver/smart_logging/unified_logger.py +0 -525
- unrealon_driver/websocket/__init__.py +0 -31
- unrealon_driver/websocket/client.py +0 -249
- unrealon_driver/websocket/config.py +0 -188
- unrealon_driver/websocket/manager.py +0 -90
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Clean threading manager.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
7
|
+
from typing import Any, Callable, Optional, Dict
|
|
8
|
+
from pydantic import Field
|
|
9
|
+
|
|
10
|
+
from .base import BaseManager, ManagerConfig
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ThreadManagerConfig(ManagerConfig):
|
|
14
|
+
"""Thread manager configuration."""
|
|
15
|
+
max_workers: int = Field(default=4, description="Max thread workers")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ThreadManager(BaseManager):
|
|
19
|
+
"""Simple thread pool manager."""
|
|
20
|
+
|
|
21
|
+
def __init__(self, config: ThreadManagerConfig):
|
|
22
|
+
super().__init__(config, "threading")
|
|
23
|
+
self.config: ThreadManagerConfig = config
|
|
24
|
+
self.executor: Optional[ThreadPoolExecutor] = None
|
|
25
|
+
|
|
26
|
+
async def _initialize(self) -> bool:
|
|
27
|
+
"""Initialize thread pool."""
|
|
28
|
+
self.executor = ThreadPoolExecutor(
|
|
29
|
+
max_workers=self.config.max_workers,
|
|
30
|
+
thread_name_prefix="unrealon-driver"
|
|
31
|
+
)
|
|
32
|
+
return True
|
|
33
|
+
|
|
34
|
+
async def _shutdown(self):
|
|
35
|
+
"""Shutdown thread pool."""
|
|
36
|
+
if self.executor:
|
|
37
|
+
self.executor.shutdown(wait=True)
|
|
38
|
+
self.executor = None
|
|
39
|
+
|
|
40
|
+
async def run_in_thread(self, func: Callable, *args, **kwargs) -> Any:
|
|
41
|
+
"""Run function in thread pool."""
|
|
42
|
+
if not self.executor:
|
|
43
|
+
raise RuntimeError("Thread manager not initialized")
|
|
44
|
+
|
|
45
|
+
loop = asyncio.get_event_loop()
|
|
46
|
+
return await loop.run_in_executor(self.executor, func, *args, **kwargs)
|
|
47
|
+
|
|
48
|
+
async def _health_check(self) -> Dict[str, Any]:
|
|
49
|
+
"""Thread manager health check."""
|
|
50
|
+
return {
|
|
51
|
+
"status": "ok",
|
|
52
|
+
"max_workers": self.config.max_workers,
|
|
53
|
+
"active": self.executor is not None
|
|
54
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Clean update manager for driver updates.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
from typing import Dict, Any, Optional
|
|
7
|
+
from pydantic import Field
|
|
8
|
+
|
|
9
|
+
from .base import BaseManager, ManagerConfig
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class UpdateManagerConfig(ManagerConfig):
|
|
13
|
+
"""Update manager configuration."""
|
|
14
|
+
check_interval: int = Field(default=3600, description="Update check interval seconds")
|
|
15
|
+
auto_update: bool = Field(default=False, description="Enable auto updates")
|
|
16
|
+
update_url: Optional[str] = Field(default=None, description="Update server URL")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class UpdateManager(BaseManager):
|
|
20
|
+
"""Simple update manager."""
|
|
21
|
+
|
|
22
|
+
def __init__(self, config: UpdateManagerConfig):
|
|
23
|
+
super().__init__(config, "update")
|
|
24
|
+
self.config: UpdateManagerConfig = config
|
|
25
|
+
self._check_task: Optional[asyncio.Task] = None
|
|
26
|
+
self.last_check: Optional[str] = None
|
|
27
|
+
self.update_available: bool = False
|
|
28
|
+
|
|
29
|
+
async def _initialize(self) -> bool:
|
|
30
|
+
"""Initialize update manager."""
|
|
31
|
+
if self.config.update_url:
|
|
32
|
+
# Start update check task
|
|
33
|
+
self._check_task = asyncio.create_task(self._update_check_loop())
|
|
34
|
+
|
|
35
|
+
return True
|
|
36
|
+
|
|
37
|
+
async def _shutdown(self):
|
|
38
|
+
"""Shutdown update manager."""
|
|
39
|
+
if self._check_task:
|
|
40
|
+
self._check_task.cancel()
|
|
41
|
+
try:
|
|
42
|
+
await self._check_task
|
|
43
|
+
except asyncio.CancelledError:
|
|
44
|
+
pass
|
|
45
|
+
|
|
46
|
+
async def _update_check_loop(self):
|
|
47
|
+
"""Background update checking."""
|
|
48
|
+
while True:
|
|
49
|
+
try:
|
|
50
|
+
await asyncio.sleep(self.config.check_interval)
|
|
51
|
+
await self.check_for_updates()
|
|
52
|
+
|
|
53
|
+
except asyncio.CancelledError:
|
|
54
|
+
break
|
|
55
|
+
except Exception as e:
|
|
56
|
+
self.logger.error(f"Update check error: {e}")
|
|
57
|
+
|
|
58
|
+
async def check_for_updates(self) -> bool:
|
|
59
|
+
"""Check for available updates."""
|
|
60
|
+
try:
|
|
61
|
+
# Placeholder for actual update checking logic
|
|
62
|
+
self.logger.info("Checking for updates...")
|
|
63
|
+
|
|
64
|
+
# TODO: Implement actual update checking
|
|
65
|
+
# This would typically involve:
|
|
66
|
+
# 1. Fetching version info from update server
|
|
67
|
+
# 2. Comparing with current version
|
|
68
|
+
# 3. Setting update_available flag
|
|
69
|
+
|
|
70
|
+
self.last_check = "checked"
|
|
71
|
+
return False
|
|
72
|
+
|
|
73
|
+
except Exception as e:
|
|
74
|
+
self.logger.error(f"Update check failed: {e}")
|
|
75
|
+
return False
|
|
76
|
+
|
|
77
|
+
async def perform_update(self) -> bool:
|
|
78
|
+
"""Perform driver update."""
|
|
79
|
+
try:
|
|
80
|
+
if not self.update_available:
|
|
81
|
+
self.logger.info("No updates available")
|
|
82
|
+
return False
|
|
83
|
+
|
|
84
|
+
# Placeholder for actual update logic
|
|
85
|
+
self.logger.info("Performing update...")
|
|
86
|
+
|
|
87
|
+
# TODO: Implement actual update process
|
|
88
|
+
# This would typically involve:
|
|
89
|
+
# 1. Downloading new version
|
|
90
|
+
# 2. Validating download
|
|
91
|
+
# 3. Installing update
|
|
92
|
+
# 4. Restarting driver
|
|
93
|
+
|
|
94
|
+
return True
|
|
95
|
+
|
|
96
|
+
except Exception as e:
|
|
97
|
+
self.logger.error(f"Update failed: {e}")
|
|
98
|
+
return False
|
|
99
|
+
|
|
100
|
+
async def _health_check(self) -> Dict[str, Any]:
|
|
101
|
+
"""Update manager health check."""
|
|
102
|
+
return {
|
|
103
|
+
"status": "ok",
|
|
104
|
+
"last_check": self.last_check,
|
|
105
|
+
"update_available": self.update_available,
|
|
106
|
+
"auto_update": self.config.auto_update
|
|
107
|
+
}
|