unrealon 2.0.10__tar.gz → 2.0.12__tar.gz

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 (146) hide show
  1. {unrealon-2.0.10 → unrealon-2.0.12}/MANIFEST.in +1 -6
  2. {unrealon-2.0.10/unrealon.egg-info → unrealon-2.0.12}/PKG-INFO +1 -1
  3. {unrealon-2.0.10 → unrealon-2.0.12}/pyproject.toml +1 -1
  4. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/core/browser_manager.py +58 -0
  5. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/managers/logger_bridge.py +3 -3
  6. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/managers/script_manager.py +45 -26
  7. unrealon-2.0.10/unrealon-browser/src/unrealon_browser/stealth/bypass_techniques.pyc → unrealon-2.0.12/unrealon-browser/src/unrealon_browser/stealth/bypass_techniques.py +0 -0
  8. unrealon-2.0.12/unrealon-browser/src/unrealon_browser/stealth/manager.py +507 -0
  9. unrealon-2.0.12/unrealon-browser/src/unrealon_browser/stealth/nodriver_stealth.py +432 -0
  10. unrealon-2.0.12/unrealon-browser/src/unrealon_browser/stealth/playwright_stealth.py +179 -0
  11. unrealon-2.0.12/unrealon-browser/src/unrealon_browser/stealth/scanner_tester.py +355 -0
  12. unrealon-2.0.12/unrealon-browser/src/unrealon_browser/stealth/undetected_chrome.py +361 -0
  13. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/__init__.py +12 -2
  14. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/factory/manager_factory.py +8 -1
  15. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/managers/browser.py +16 -1
  16. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/managers/proxy.py +11 -4
  17. unrealon-2.0.12/unrealon-driver/src/unrealon_driver/utils/__init__.py +18 -0
  18. unrealon-2.0.12/unrealon-driver/src/unrealon_driver/utils/platform_compatibility.py +205 -0
  19. {unrealon-2.0.10 → unrealon-2.0.12/unrealon.egg-info}/PKG-INFO +1 -1
  20. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon.egg-info/SOURCES.txt +7 -6
  21. unrealon-2.0.10/unrealon-browser/src/unrealon_browser/stealth/manager.pyc +0 -0
  22. unrealon-2.0.10/unrealon-browser/src/unrealon_browser/stealth/nodriver_stealth.pyc +0 -0
  23. unrealon-2.0.10/unrealon-browser/src/unrealon_browser/stealth/playwright_stealth.pyc +0 -0
  24. unrealon-2.0.10/unrealon-browser/src/unrealon_browser/stealth/scanner_tester.pyc +0 -0
  25. unrealon-2.0.10/unrealon-browser/src/unrealon_browser/stealth/undetected_chrome.pyc +0 -0
  26. unrealon-2.0.10/unrealon-driver/src/unrealon_driver/utils/__init__.py +0 -9
  27. {unrealon-2.0.10 → unrealon-2.0.12}/LICENSE +0 -0
  28. {unrealon-2.0.10 → unrealon-2.0.12}/README.md +0 -0
  29. {unrealon-2.0.10 → unrealon-2.0.12}/setup.cfg +0 -0
  30. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/README.md +0 -0
  31. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/__init__.py +0 -0
  32. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/cli/__init__.py +0 -0
  33. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/cli/browser_cli.py +0 -0
  34. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/cli/cookies_cli.py +0 -0
  35. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/cli/interactive_mode.py +0 -0
  36. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/cli/main.py +0 -0
  37. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/core/__init__.py +0 -0
  38. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/dto/__init__.py +0 -0
  39. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/dto/bot_detection.py +0 -0
  40. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/dto/models/config.py +0 -0
  41. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/dto/models/core.py +0 -0
  42. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/dto/models/dataclasses.py +0 -0
  43. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/dto/models/detection.py +0 -0
  44. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/dto/models/enums.py +0 -0
  45. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/dto/models/statistics.py +0 -0
  46. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/managers/__init__.py +0 -0
  47. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/managers/captcha.py +0 -0
  48. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/managers/cookies.py +0 -0
  49. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/managers/page_wait_manager.py +0 -0
  50. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/managers/profile.py +0 -0
  51. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-browser/src/unrealon_browser/stealth/__init__.py +0 -0
  52. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/__init__.py +0 -0
  53. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/config/__init__.py +0 -0
  54. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/config/environment.py +0 -0
  55. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/config/urls.py +0 -0
  56. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/enums/__init__.py +0 -0
  57. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/enums/events.py +0 -0
  58. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/enums/jobs.py +0 -0
  59. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/enums/status.py +0 -0
  60. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/enums/types.py +0 -0
  61. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/error_handling/__init__.py +0 -0
  62. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/error_handling/circuit_breaker.py +0 -0
  63. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/error_handling/error_context.py +0 -0
  64. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/error_handling/recovery.py +0 -0
  65. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/error_handling/retry.py +0 -0
  66. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/exceptions/__init__.py +0 -0
  67. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/exceptions/base.py +0 -0
  68. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/exceptions/communication.py +0 -0
  69. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/exceptions/driver.py +0 -0
  70. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/exceptions/proxy.py +0 -0
  71. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/exceptions/task.py +0 -0
  72. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/exceptions/validation.py +0 -0
  73. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/__init__.py +0 -0
  74. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/arq_context.py +0 -0
  75. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/arq_responses.py +0 -0
  76. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/authentication.py +0 -0
  77. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/base.py +0 -0
  78. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/bridge_stats.py +0 -0
  79. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/communication.py +0 -0
  80. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/connection_stats.py +0 -0
  81. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/driver.py +0 -0
  82. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/driver_details.py +0 -0
  83. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/logging.py +0 -0
  84. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/task.py +0 -0
  85. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/typed_responses.py +0 -0
  86. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/websocket/__init__.py +0 -0
  87. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/websocket/base.py +0 -0
  88. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/websocket/broadcast.py +0 -0
  89. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/websocket/config.py +0 -0
  90. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/websocket/driver.py +0 -0
  91. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/websocket/errors.py +0 -0
  92. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/websocket/heartbeat.py +0 -0
  93. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/websocket/logging.py +0 -0
  94. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/websocket/proxy.py +0 -0
  95. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/websocket/tasks.py +0 -0
  96. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/websocket/utils.py +0 -0
  97. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/models/websocket_session.py +0 -0
  98. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/monitoring/__init__.py +0 -0
  99. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/monitoring/alerts.py +0 -0
  100. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/monitoring/dashboard.py +0 -0
  101. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/monitoring/health_check.py +0 -0
  102. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/monitoring/metrics.py +0 -0
  103. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/utils/__init__.py +0 -0
  104. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/utils/time.py +0 -0
  105. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-core/src/unrealon_core/version.py +0 -0
  106. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/core_module/__init__.py +0 -0
  107. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/core_module/base.py +0 -0
  108. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/core_module/config.py +0 -0
  109. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/core_module/event_manager.py +0 -0
  110. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/core_module/protocols.py +0 -0
  111. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/core_module/registry.py +0 -0
  112. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/decorators/__init__.py +0 -0
  113. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/decorators/retry.py +0 -0
  114. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/decorators/schedule.py +0 -0
  115. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/decorators/task.py +0 -0
  116. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/decorators/timing.py +0 -0
  117. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/__init__.py +0 -0
  118. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/communication/__init__.py +0 -0
  119. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/communication/session.py +0 -0
  120. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/communication/websocket_client.py +0 -0
  121. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/core/__init__.py +0 -0
  122. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/core/config.py +0 -0
  123. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/core/driver.py +0 -0
  124. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/factory/__init__.py +0 -0
  125. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/lifecycle/__init__.py +0 -0
  126. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/lifecycle/daemon.py +0 -0
  127. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/lifecycle/initialization.py +0 -0
  128. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/lifecycle/shutdown.py +0 -0
  129. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/monitoring/__init__.py +0 -0
  130. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/monitoring/health.py +0 -0
  131. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/utilities/__init__.py +0 -0
  132. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/utilities/logging.py +0 -0
  133. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/driver/utilities/serialization.py +0 -0
  134. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/managers/__init__.py +0 -0
  135. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/managers/base.py +0 -0
  136. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/managers/cache.py +0 -0
  137. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/managers/http.py +0 -0
  138. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/managers/logger.py +0 -0
  139. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/managers/registry.py +0 -0
  140. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/managers/threading.py +0 -0
  141. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/managers/update.py +0 -0
  142. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon-driver/src/unrealon_driver/utils/time.py +0 -0
  143. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon.egg-info/dependency_links.txt +0 -0
  144. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon.egg-info/entry_points.txt +0 -0
  145. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon.egg-info/requires.txt +0 -0
  146. {unrealon-2.0.10 → unrealon-2.0.12}/unrealon.egg-info/top_level.txt +0 -0
@@ -6,13 +6,8 @@ include pyproject.toml
6
6
  recursive-include unrealon-core/src *.py
7
7
  recursive-include unrealon-driver/src *.py
8
8
 
9
- # Include browser files (except stealth .py files)
9
+ # Include all browser files including stealth .py files
10
10
  recursive-include unrealon-browser/src *.py
11
- exclude unrealon-browser/src/unrealon_browser/stealth/*.py
12
-
13
- # Include only protected stealth files (.pyc) and __init__.py
14
- include unrealon-browser/src/unrealon_browser/stealth/*.pyc
15
- include unrealon-browser/src/unrealon_browser/stealth/__init__.py
16
11
 
17
12
  # Exclude development files (but not stealth .pyc files)
18
13
  recursive-exclude unrealon-core *.pyc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unrealon
3
- Version: 2.0.10
3
+ Version: 2.0.12
4
4
  Summary: Enterprise-grade web scraping platform with AI-powered automation and real-time orchestration capabilities
5
5
  Author-email: UnrealOn Team <team@unrealon.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "unrealon"
7
- version = "2.0.10"
7
+ version = "2.0.12"
8
8
  description = "Enterprise-grade web scraping platform with AI-powered automation and real-time orchestration capabilities"
9
9
  authors = [
10
10
  {name = "UnrealOn Team", email = "team@unrealon.com"}
@@ -55,6 +55,9 @@ class BrowserManager:
55
55
  self._page = None
56
56
  self._initialized = False
57
57
  self._statistics = BrowserManagerStatistics()
58
+
59
+ # Proxy settings (can be set externally)
60
+ self._proxy_url: Optional[str] = None
58
61
 
59
62
  # Initialize logger bridge first
60
63
  self.logger_bridge = create_browser_logger_bridge(session_id=self._generate_session_id(), parser_id=self.parser_id, enable_console=True) # Use resolved parser_id
@@ -197,6 +200,12 @@ class BrowserManager:
197
200
  "ignore_default_args": ["--enable-automation"],
198
201
  **context_options, # viewport, user_agent, etc.
199
202
  }
203
+
204
+ # Add proxy configuration for persistent context
205
+ if self._proxy_url:
206
+ proxy_config = self._get_playwright_proxy_config()
207
+ if proxy_config:
208
+ persistent_args["proxy"] = proxy_config
200
209
 
201
210
  # Use persistent context with user_data_dir for profiles
202
211
  if self.config.browser_type == BrowserType.CHROMIUM:
@@ -223,6 +232,12 @@ class BrowserManager:
223
232
  raise ValueError(f"Unsupported browser type: {self.config.browser_type}")
224
233
 
225
234
  # Create context without profile
235
+ # Add proxy configuration for context
236
+ if self._proxy_url:
237
+ proxy_config = self._get_playwright_proxy_config()
238
+ if proxy_config:
239
+ context_options["proxy"] = proxy_config
240
+
226
241
  self._context = await self._browser.new_context(**context_options)
227
242
 
228
243
  # 🔥 STEALTH ALWAYS ON - NO CONFIG NEEDED!
@@ -276,6 +291,9 @@ class BrowserManager:
276
291
  # 🔥 STEALTH ALWAYS ON - ALWAYS ADD STEALTH ARGS!
277
292
  browser_args.extend(self.stealth_manager.get_stealth_args())
278
293
 
294
+ # Note: Proxy configuration is now handled via Playwright API in context options
295
+ # instead of command line arguments for better compatibility
296
+
279
297
  if self.config.disable_images:
280
298
  browser_args.extend(
281
299
  [
@@ -286,6 +304,46 @@ class BrowserManager:
286
304
 
287
305
  args["args"] = browser_args
288
306
  return args
307
+
308
+ def _get_playwright_proxy_config(self) -> Optional[Dict[str, Any]]:
309
+ """
310
+ Get Playwright-compatible proxy configuration.
311
+
312
+ Returns:
313
+ Proxy configuration dict for Playwright or None if not supported
314
+ """
315
+ if not self._proxy_url:
316
+ return None
317
+
318
+ try:
319
+ from urllib.parse import urlparse
320
+
321
+ parsed = urlparse(self._proxy_url)
322
+
323
+ # Playwright proxy configuration
324
+ proxy_config = {
325
+ "server": f"{parsed.scheme}://{parsed.hostname}:{parsed.port}"
326
+ }
327
+
328
+ # Add authentication if present
329
+ if parsed.username and parsed.password:
330
+ # WARNING: Playwright does NOT support SOCKS5 authentication!
331
+ if parsed.scheme == 'socks5':
332
+ self.logger_bridge.log_warning("⚠️ Playwright does not support SOCKS5 authentication!")
333
+ self.logger_bridge.log_warning("⚠️ Falling back to SOCKS5 without auth - may fail!")
334
+ # Return configuration without authentication for SOCKS5
335
+ return proxy_config
336
+ else:
337
+ # HTTP/HTTPS proxies support authentication
338
+ proxy_config["username"] = parsed.username
339
+ proxy_config["password"] = parsed.password
340
+
341
+ self.logger_bridge.log_info(f"🔒 Playwright proxy config: {proxy_config['server']}")
342
+ return proxy_config
343
+
344
+ except Exception as e:
345
+ self.logger_bridge.log_error(f"❌ Failed to parse proxy URL: {e}")
346
+ return None
289
347
 
290
348
  def _get_context_options(self) -> Dict[str, Any]:
291
349
  """Get browser context options"""
@@ -168,17 +168,17 @@ class BrowserLoggerBridge:
168
168
  )
169
169
 
170
170
  def log_stealth_applied(self, success: bool = True) -> None:
171
- """Log stealth application - 🔥 STEALTH ALWAYS ON!"""
171
+ """Log stealth application"""
172
172
  self._browser_events["stealth_applied"] += 1
173
173
 
174
174
  if success:
175
175
  self._log_info(
176
- "Stealth measures applied: ALWAYS_ON",
176
+ "Stealth measures applied",
177
177
  stealth_success=True,
178
178
  )
179
179
  else:
180
180
  self._log_warning(
181
- "Stealth application failed: ALWAYS_ON",
181
+ "Stealth application failed",
182
182
  stealth_success=False,
183
183
  )
184
184
 
@@ -18,7 +18,8 @@ class ScriptManager:
18
18
  def __init__(self, page: Optional[Page], logger_bridge: LoggingBridge):
19
19
  self._page = page
20
20
  self.logger_bridge = logger_bridge
21
-
21
+ self.allow_logging = False
22
+
22
23
  # Statistics
23
24
  self._scripts_executed = 0
24
25
  self._scripts_successful = 0
@@ -29,7 +30,25 @@ class ScriptManager:
29
30
  def update_page(self, page: Optional[Page]):
30
31
  """Update the page reference"""
31
32
  self._page = page
32
-
33
+
34
+ def log_error(self, message: str):
35
+ """Log error"""
36
+ if not self.allow_logging:
37
+ return
38
+ self.logger_bridge.log_error(message)
39
+
40
+ def log_info(self, message: str):
41
+ """Log info"""
42
+ if not self.allow_logging:
43
+ return
44
+ self.logger_bridge.log_info(message)
45
+
46
+ def log_debug(self, message: str):
47
+ """Log debug"""
48
+ if not self.allow_logging:
49
+ return
50
+ self.logger_bridge.log_debug(message)
51
+
33
52
  async def execute_script(self, script: str, timeout: int = 30000) -> Any:
34
53
  """
35
54
  Execute JavaScript code and return result
@@ -48,8 +67,8 @@ class ScriptManager:
48
67
  self._scripts_executed += 1
49
68
 
50
69
  try:
51
- self.logger_bridge.log_info(f"🔧 Executing JavaScript (timeout: {timeout}ms)")
52
- self.logger_bridge.log_debug(f"Script preview: {script[:100]}...")
70
+ self.log_info(f"🔧 Executing JavaScript (timeout: {timeout}ms)")
71
+ self.log_debug(f"Script preview: {script[:100]}...")
53
72
 
54
73
  # Execute script with timeout
55
74
  result = await asyncio.wait_for(
@@ -70,8 +89,8 @@ class ScriptManager:
70
89
  }
71
90
  self._execution_history.append(execution_record)
72
91
 
73
- self.logger_bridge.log_info(f"✅ Script executed successfully ({duration_ms:.1f}ms)")
74
- self.logger_bridge.log_debug(f"Result type: {type(result).__name__}")
92
+ self.log_info(f"✅ Script executed successfully ({duration_ms:.1f}ms)")
93
+ self.log_debug(f"Result type: {type(result).__name__}")
75
94
 
76
95
  return result
77
96
 
@@ -88,7 +107,7 @@ class ScriptManager:
88
107
  }
89
108
  self._execution_history.append(execution_record)
90
109
 
91
- self.logger_bridge.log_error(f"⏰ Script execution timeout ({timeout}ms)")
110
+ self.log_error(f"⏰ Script execution timeout ({timeout}ms)")
92
111
  raise
93
112
 
94
113
  except Exception as e:
@@ -104,7 +123,7 @@ class ScriptManager:
104
123
  }
105
124
  self._execution_history.append(execution_record)
106
125
 
107
- self.logger_bridge.log_error(f"❌ Script execution failed: {e}")
126
+ self.log_error(f"❌ Script execution failed: {e}")
108
127
  raise
109
128
 
110
129
  async def execute_api_call(self, api_url: str, headers: Dict[str, str], method: str = "GET", timeout: int = 30000) -> Dict[str, Any]:
@@ -145,14 +164,14 @@ class ScriptManager:
145
164
  }})()
146
165
  """
147
166
 
148
- self.logger_bridge.log_info(f"🌐 Making API call: {method} {api_url}")
167
+ self.log_info(f"🌐 Making API call: {method} {api_url}")
149
168
 
150
169
  result = await self.execute_script(script, timeout)
151
170
 
152
171
  if isinstance(result, dict) and 'error' in result:
153
- self.logger_bridge.log_error(f"❌ API call failed: {result['error']}")
172
+ self.log_error(f"❌ API call failed: {result['error']}")
154
173
  else:
155
- self.logger_bridge.log_info(f"✅ API call successful")
174
+ self.log_info(f"✅ API call successful")
156
175
 
157
176
  return result
158
177
 
@@ -198,17 +217,17 @@ class ScriptManager:
198
217
  }})()
199
218
  """
200
219
 
201
- self.logger_bridge.log_info(f"🎯 Waiting for element: {selector}")
220
+ self.log_info(f"🎯 Waiting for element: {selector}")
202
221
 
203
222
  try:
204
223
  result = await self.execute_script(script, timeout + 1000)
205
224
  if result:
206
- self.logger_bridge.log_info(f"✅ Element found: {selector}")
225
+ self.log_info(f"✅ Element found: {selector}")
207
226
  else:
208
- self.logger_bridge.log_warning(f"⏰ Element timeout: {selector}")
227
+ self.log_warning(f"⏰ Element timeout: {selector}")
209
228
  return result
210
229
  except Exception as e:
211
- self.logger_bridge.log_error(f"❌ Element wait failed: {selector} - {e}")
230
+ self.log_error(f"❌ Element wait failed: {selector} - {e}")
212
231
  return False
213
232
 
214
233
  async def inject_helper_functions(self) -> bool:
@@ -271,10 +290,10 @@ class ScriptManager:
271
290
 
272
291
  try:
273
292
  await self.execute_script(helper_script)
274
- self.logger_bridge.log_info("🔧 Helper functions injected successfully")
293
+ self.log_info("🔧 Helper functions injected successfully")
275
294
  return True
276
295
  except Exception as e:
277
- self.logger_bridge.log_error(f"❌ Failed to inject helper functions: {e}")
296
+ self.log_error(f"❌ Failed to inject helper functions: {e}")
278
297
  return False
279
298
 
280
299
  def get_statistics(self) -> Dict[str, Any]:
@@ -294,21 +313,21 @@ class ScriptManager:
294
313
  """Print script execution statistics"""
295
314
  stats = self.get_statistics()
296
315
 
297
- self.logger_bridge.log_info("\n🔧 Script Manager Statistics:")
298
- self.logger_bridge.log_info(f" Scripts executed: {stats['scripts_executed']}")
299
- self.logger_bridge.log_info(f" Successful: {stats['scripts_successful']}")
300
- self.logger_bridge.log_info(f" Failed: {stats['scripts_failed']}")
301
- self.logger_bridge.log_info(f" Success rate: {stats['success_rate']:.1f}%")
302
- self.logger_bridge.log_info(f" API calls made: {stats['api_calls_made']}")
316
+ print("\n🔧 Script Manager Statistics:")
317
+ print(f" Scripts executed: {stats['scripts_executed']}")
318
+ print(f" Successful: {stats['scripts_successful']}")
319
+ print(f" Failed: {stats['scripts_failed']}")
320
+ print(f" Success rate: {stats['success_rate']:.1f}%")
321
+ print(f" API calls made: {stats['api_calls_made']}")
303
322
 
304
323
  # Show recent executions
305
324
  if self._execution_history:
306
- self.logger_bridge.log_info(" Recent executions:")
325
+ print(" Recent executions:")
307
326
  for execution in self._execution_history[-3:]: # Show last 3
308
327
  status = "✅" if execution["success"] else "❌"
309
- self.logger_bridge.log_info(f" {status} {execution['duration_ms']:.1f}ms")
328
+ print(f" {status} {execution['duration_ms']:.1f}ms")
310
329
 
311
330
  def clear_history(self) -> None:
312
331
  """Clear execution history"""
313
332
  self._execution_history.clear()
314
- self.logger_bridge.log_info("🧹 Cleared script execution history")
333
+ self.log_info("🧹 Cleared script execution history")