intuned-runtime 1.3.5__py3-none-any.whl → 1.3.6__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.
Potentially problematic release.
This version of intuned-runtime might be problematic. Click here for more details.
- {intuned_runtime-1.3.5.dist-info → intuned_runtime-1.3.6.dist-info}/METADATA +1 -1
- {intuned_runtime-1.3.5.dist-info → intuned_runtime-1.3.6.dist-info}/RECORD +10 -10
- runtime/browser/extensions/intuned_extension.py +9 -9
- runtime/browser/extensions/intuned_extension_server.py +3 -8
- runtime/browser/launch_chromium.py +3 -0
- runtime/helpers/extensions.py +7 -7
- runtime/types/settings_types.py +5 -2
- {intuned_runtime-1.3.5.dist-info → intuned_runtime-1.3.6.dist-info}/WHEEL +0 -0
- {intuned_runtime-1.3.5.dist-info → intuned_runtime-1.3.6.dist-info}/entry_points.txt +0 -0
- {intuned_runtime-1.3.5.dist-info → intuned_runtime-1.3.6.dist-info}/licenses/LICENSE +0 -0
|
@@ -71,12 +71,12 @@ runtime/backend_functions/get_auth_session_parameters.py,sha256=pOvB7XiWpphEuBpa
|
|
|
71
71
|
runtime/browser/__init__.py,sha256=EPWfa4ZmdR8GJqh2qcsx1ZvHmCYiUYrQ-zeHYVapH9s,285
|
|
72
72
|
runtime/browser/extensions/__init__.py,sha256=Z97932wq-htiw4yEejV21oZfqdOm1VjRbuotlseSSAY,194
|
|
73
73
|
runtime/browser/extensions/helpers.py,sha256=W3XiOf66J_xWpa4-U7hQjW0CfAucCYz12pBcIRnzLTQ,387
|
|
74
|
-
runtime/browser/extensions/intuned_extension.py,sha256=
|
|
75
|
-
runtime/browser/extensions/intuned_extension_server.py,sha256=
|
|
74
|
+
runtime/browser/extensions/intuned_extension.py,sha256=RskyxYjW989KOieXgdmSIZcZleBIjlZHKessHAiOvus,3013
|
|
75
|
+
runtime/browser/extensions/intuned_extension_server.py,sha256=7VZyJR-Qq11SGtxBwTWwjfdjJxWajQqeXkRs1H5Mu84,6908
|
|
76
76
|
runtime/browser/helpers.py,sha256=CwgiBToawPgwAY9nIGkGHW544N7Db_OgKmS-SHkN2pU,1255
|
|
77
77
|
runtime/browser/launch_browser.py,sha256=MFo9Nb9eQgGO3w3ngRp9epzolcTBvekDQudZwIE6_74,2516
|
|
78
78
|
runtime/browser/launch_camoufox.py,sha256=TBOAwwipNGlbtMdFYnGkVM0ppLU44vWNkMGZA5uPZCE,1787
|
|
79
|
-
runtime/browser/launch_chromium.py,sha256=
|
|
79
|
+
runtime/browser/launch_chromium.py,sha256=T-C89bhRqC3XhJdNv_1AGcXQM8oqCCGBX1ijNhRjovc,9285
|
|
80
80
|
runtime/browser/storage_state.py,sha256=fwLg8sP-H-vgt_6AJKNl03CpgyMVCQWWcN2cqswTQMs,3603
|
|
81
81
|
runtime/constants.py,sha256=YMYQgCWZdJXUpxz_IN2TvZO5rFye9k_Lk9CS8m-shLg,34
|
|
82
82
|
runtime/context/__init__.py,sha256=hg8ejm4bJy4tNkwmZ9lKgYJx6bU7OgOdBS684Uv5XGg,73
|
|
@@ -90,7 +90,7 @@ runtime/helpers/__init__.py,sha256=rkywrr_76AMaIsAAjsVmmfLh8BjB5_E6AeJY5sWFm6U,2
|
|
|
90
90
|
runtime/helpers/attempt_store.py,sha256=YPwGHkdJNbC8rSiQ1vOReKNOQrjPT1wpO9ZDcQf530I,339
|
|
91
91
|
runtime/helpers/extend_payload.py,sha256=towZF08WTpTTDBL4AV1bUU3XpKAQHEB66kGUfTICDe0,246
|
|
92
92
|
runtime/helpers/extend_timeout.py,sha256=KjfSLEUrqoz7v00rhnPAKq2OmUzEzcv-eQ3M8c2U46s,348
|
|
93
|
-
runtime/helpers/extensions.py,sha256=
|
|
93
|
+
runtime/helpers/extensions.py,sha256=_4M_bi76sgmYGNPh1vqaF_WuV-uJtTjqiMWtC2TX8zg,12926
|
|
94
94
|
runtime/helpers/get_auth_session_parameters.py,sha256=7bopGhJ7vjKAn_UxnHSAah-k2rVOPbq0zi9FQOOCFds,472
|
|
95
95
|
runtime/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
96
96
|
runtime/run/__init__.py,sha256=zxMYVb7hn147YTrhMLsrcX6-KTd71HLrYHstJOWeWXQ,52
|
|
@@ -105,14 +105,14 @@ runtime/run/types.py,sha256=-7ACaxa5vg2qHw14JunvUWt-AchanTQU4FRF57DxJWo,287
|
|
|
105
105
|
runtime/types/__init__.py,sha256=LWf5iOMgbve_BrpVP-LWWzDD3v2K4Y2sLxthOnVEqyY,539
|
|
106
106
|
runtime/types/payload.py,sha256=sty8HgDEn3nJbZrwEOMCXyuG7_ICGDwlBIIWSON5ABY,124
|
|
107
107
|
runtime/types/run_types.py,sha256=GcYLkL2BHxOjT4O3KvBP6xjBKsmJbjltMt_5bCVnfCI,4554
|
|
108
|
-
runtime/types/settings_types.py,sha256=
|
|
108
|
+
runtime/types/settings_types.py,sha256=pamaKw1kpsB_UpLGvIQRdE1gusmatVp8yhzMte57C4A,3469
|
|
109
109
|
runtime/utils/__init__.py,sha256=v0qHjnc54YCkY1yPbXuihgymVZau_15xaEVyaFQj9ts,78
|
|
110
110
|
runtime/utils/anyio.py,sha256=KNemAQmmS425YKbVH_7DAE5lcDG_UziJHHTt9YJKS4o,697
|
|
111
111
|
runtime/utils/config_loader.py,sha256=yqk2eDGbgyw0Xslgd3dJbB28NjUe02L9LyCxzCmH9r4,482
|
|
112
112
|
runtime_helpers/__init__.py,sha256=1BPzEc-qC2WAYiCWDOJChpgnFyO3ZNYRKHEZqdHUGwM,322
|
|
113
113
|
runtime_helpers/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
114
|
-
intuned_runtime-1.3.
|
|
115
|
-
intuned_runtime-1.3.
|
|
116
|
-
intuned_runtime-1.3.
|
|
117
|
-
intuned_runtime-1.3.
|
|
118
|
-
intuned_runtime-1.3.
|
|
114
|
+
intuned_runtime-1.3.6.dist-info/METADATA,sha256=RPpd6JyWBVcTHN7myBd30qEN3Dq0wGceqT7LpTHN1lc,5512
|
|
115
|
+
intuned_runtime-1.3.6.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
116
|
+
intuned_runtime-1.3.6.dist-info/entry_points.txt,sha256=ToMS2cqDeRmF1FGkflwoeD-Xz6jJV5p1zIbw9G7IxMg,85
|
|
117
|
+
intuned_runtime-1.3.6.dist-info/licenses/LICENSE,sha256=9LIjQdgyU_ptzNIfItNCR7VmEHqYnrY1f1XwOreKFI0,3714
|
|
118
|
+
intuned_runtime-1.3.6.dist-info/RECORD,,
|
|
@@ -51,13 +51,7 @@ async def get_intuned_worker(context: BrowserContext):
|
|
|
51
51
|
return None
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
async def get_intuned_extension_settings() -> dict[str, Any]:
|
|
55
|
-
intuned_json = await load_intuned_json()
|
|
56
|
-
captcha_settings: CaptchaSolverSettings = (
|
|
57
|
-
intuned_json.captcha_solver
|
|
58
|
-
if intuned_json and intuned_json.captcha_solver is not None
|
|
59
|
-
else CaptchaSolverSettings()
|
|
60
|
-
)
|
|
54
|
+
async def get_intuned_extension_settings(captcha_settings: CaptchaSolverSettings) -> dict[str, Any]:
|
|
61
55
|
context = IntunedContext.current()
|
|
62
56
|
return {
|
|
63
57
|
**captcha_settings.model_dump(mode="json"),
|
|
@@ -71,14 +65,20 @@ async def get_intuned_extension_settings() -> dict[str, Any]:
|
|
|
71
65
|
async def setup_intuned_extension():
|
|
72
66
|
if not is_intuned_extension_enabled():
|
|
73
67
|
return
|
|
74
|
-
await
|
|
68
|
+
intuned_json = await load_intuned_json()
|
|
69
|
+
captcha_settings: CaptchaSolverSettings = (
|
|
70
|
+
intuned_json.captcha_solver
|
|
71
|
+
if intuned_json and intuned_json.captcha_solver is not None
|
|
72
|
+
else CaptchaSolverSettings()
|
|
73
|
+
)
|
|
74
|
+
await setup_intuned_extension_server(captcha_settings)
|
|
75
75
|
intuned_extension_path = get_intuned_extension_path()
|
|
76
76
|
if intuned_extension_path is None:
|
|
77
77
|
logger.warning("Intuned extension path not found, intuned extension might not work properly")
|
|
78
78
|
return
|
|
79
79
|
|
|
80
80
|
settings_path = intuned_extension_path / "intunedSettings.json"
|
|
81
|
-
settings_data = await get_intuned_extension_settings()
|
|
81
|
+
settings_data = await get_intuned_extension_settings(captcha_settings)
|
|
82
82
|
|
|
83
83
|
try:
|
|
84
84
|
with open(settings_path, "w") as f:
|
|
@@ -17,7 +17,6 @@ from waitress.server import create_server
|
|
|
17
17
|
from waitress.server import MultiSocketServer
|
|
18
18
|
|
|
19
19
|
from runtime.types import CaptchaSolverSettings
|
|
20
|
-
from runtime.utils.config_loader import load_intuned_json
|
|
21
20
|
|
|
22
21
|
logging.basicConfig(level=logging.INFO)
|
|
23
22
|
logger = logging.getLogger(__name__)
|
|
@@ -158,14 +157,10 @@ event_emitter: Optional[AsyncIOEventEmitter] = None
|
|
|
158
157
|
extension_server: Optional[ExtensionServer] = None
|
|
159
158
|
|
|
160
159
|
|
|
161
|
-
async def setup_intuned_extension_server():
|
|
160
|
+
async def setup_intuned_extension_server(captcha_settings: Optional[CaptchaSolverSettings] = None):
|
|
162
161
|
global event_emitter, extension_server
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
intuned_json.captcha_solver
|
|
166
|
-
if intuned_json and intuned_json.captcha_solver is not None
|
|
167
|
-
else CaptchaSolverSettings()
|
|
168
|
-
)
|
|
162
|
+
if captcha_settings is None:
|
|
163
|
+
captcha_settings = CaptchaSolverSettings()
|
|
169
164
|
extension_server = ExtensionServer()
|
|
170
165
|
event_emitter = AsyncIOEventEmitter()
|
|
171
166
|
await extension_server.start(port=captcha_settings.port)
|
|
@@ -13,6 +13,7 @@ from runtime.browser.extensions.intuned_extension import get_intuned_worker
|
|
|
13
13
|
from runtime.browser.extensions.intuned_extension import is_intuned_extension_enabled
|
|
14
14
|
from runtime.browser.extensions.intuned_extension import setup_intuned_extension
|
|
15
15
|
from runtime.browser.extensions.intuned_extension_server import clean_intuned_extension_server
|
|
16
|
+
from runtime.browser.extensions.intuned_extension_server import setup_intuned_extension_server
|
|
16
17
|
|
|
17
18
|
from .helpers import get_local_cdp_address
|
|
18
19
|
from .helpers import get_proxy_env
|
|
@@ -68,6 +69,8 @@ async def launch_chromium(
|
|
|
68
69
|
extra_args: list[str] = []
|
|
69
70
|
async with async_playwright() as playwright:
|
|
70
71
|
if cdp_address is not None:
|
|
72
|
+
if is_intuned_extension_enabled():
|
|
73
|
+
await setup_intuned_extension_server()
|
|
71
74
|
browser: Browser = await playwright.chromium.connect_over_cdp(cdp_address)
|
|
72
75
|
context = browser.contexts[0]
|
|
73
76
|
user_preferences_dir = None
|
runtime/helpers/extensions.py
CHANGED
|
@@ -202,25 +202,25 @@ async def _wait_for_captcha_solve_core(
|
|
|
202
202
|
|
|
203
203
|
logger.debug(f"Page object: {page}")
|
|
204
204
|
|
|
205
|
-
# Execute function if provided
|
|
206
205
|
result = None
|
|
207
206
|
if func is not None:
|
|
208
207
|
result = await func()
|
|
209
208
|
|
|
210
|
-
# Wait for network to settle if requested
|
|
211
209
|
if wait_for_network_settled:
|
|
212
210
|
try:
|
|
213
211
|
await page.wait_for_load_state("networkidle", timeout=timeout)
|
|
214
212
|
except Exception as e:
|
|
215
213
|
logger.debug(f"Network idle wait failed: {e}")
|
|
216
214
|
|
|
217
|
-
# Check for captcha detection
|
|
218
215
|
detection_event: EventRequest
|
|
219
216
|
try:
|
|
220
217
|
detection_event = await wait_for_captcha_event("CAPTCHA_DETECTED", timeout=timeout)
|
|
221
|
-
except:
|
|
222
|
-
logger.
|
|
218
|
+
except asyncio.TimeoutError:
|
|
219
|
+
logger.info("CAPTCHA Detection timed out")
|
|
223
220
|
return result
|
|
221
|
+
except Exception as e:
|
|
222
|
+
logger.error(f"Error while waiting for captcha: {e}")
|
|
223
|
+
raise e
|
|
224
224
|
|
|
225
225
|
logger.info("CAPTCHA Detected, awaiting result...")
|
|
226
226
|
if detection_event.session_id is None:
|
|
@@ -263,9 +263,9 @@ async def _wait_for_captcha_solve_core(
|
|
|
263
263
|
|
|
264
264
|
logger.info("CAPTCHA solved successfully")
|
|
265
265
|
|
|
266
|
-
except asyncio.TimeoutError:
|
|
266
|
+
except asyncio.TimeoutError as e:
|
|
267
267
|
logger.error("CAPTCHA Result timeout")
|
|
268
|
-
raise
|
|
268
|
+
raise RuntimeError("CAPTCHA Solving timeout") from e
|
|
269
269
|
except Exception as e:
|
|
270
270
|
logger.error(f"CAPTCHA solve error: {e}")
|
|
271
271
|
raise
|
runtime/types/settings_types.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
import socket
|
|
2
3
|
from typing import List
|
|
3
4
|
from typing import Literal
|
|
@@ -6,7 +7,9 @@ from pydantic import BaseModel
|
|
|
6
7
|
from pydantic import Field
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
def
|
|
10
|
+
def get_intuned_captcha_extension_port():
|
|
11
|
+
if "INTUNED_CAPTCHA_EXTENSION_PORT" in os.environ:
|
|
12
|
+
return int(os.environ["INTUNED_CAPTCHA_EXTENSION_PORT"])
|
|
10
13
|
with socket.socket() as s:
|
|
11
14
|
s.bind(("", 0))
|
|
12
15
|
return s.getsockname()[1]
|
|
@@ -54,7 +57,7 @@ class CaptchaSolverSettings(BaseModel):
|
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
enabled: bool = Field(default=False)
|
|
57
|
-
port: int = Field(default_factory=
|
|
60
|
+
port: int = Field(default_factory=get_intuned_captcha_extension_port)
|
|
58
61
|
cloudflare: CaptchaSettings = Field(default_factory=CaptchaSettings)
|
|
59
62
|
google_recaptcha_v2: CaptchaSettings = Field(alias="googleRecaptchaV2", default_factory=CaptchaSettings)
|
|
60
63
|
google_recaptcha_v3: CaptchaSettings = Field(alias="googleRecaptchaV3", default_factory=CaptchaSettings)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|