intuned-runtime 1.1.1__py3-none-any.whl → 1.1.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: intuned-runtime
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: Runtime commands for Intuned platform Python scrapers
5
5
  License: Elastic-2.0
6
6
  Keywords: runtime,intuned
@@ -66,8 +66,8 @@ runtime/backend_functions/get_auth_session_parameters.py,sha256=pOvB7XiWpphEuBpa
66
66
  runtime/browser/__init__.py,sha256=EPWfa4ZmdR8GJqh2qcsx1ZvHmCYiUYrQ-zeHYVapH9s,285
67
67
  runtime/browser/helpers.py,sha256=b1Xp005adbl7ZeJrSEYgH2OPzrZEHxTPgGTsnS3OqS0,554
68
68
  runtime/browser/launch_browser.py,sha256=f71hLUDbIBEv5hhQVOQFTXleUm_X1kmEpp0kTx0SqZo,966
69
- runtime/browser/launch_camoufox.py,sha256=8dg14UfN9nBA7T075UQFhpyhvJD_aVqLdDJTNiwU0FY,1752
70
- runtime/browser/launch_chromium.py,sha256=0i0IWQO5rByPw56F_OsUp8Z55Qn2-ETQ6q5B2aXvNv4,7456
69
+ runtime/browser/launch_camoufox.py,sha256=TBOAwwipNGlbtMdFYnGkVM0ppLU44vWNkMGZA5uPZCE,1787
70
+ runtime/browser/launch_chromium.py,sha256=QY9Mxw8FImT_W23cT2zjTAeLvApzVHA_YSu0b77nfeA,7813
71
71
  runtime/browser/storage_state.py,sha256=fwLg8sP-H-vgt_6AJKNl03CpgyMVCQWWcN2cqswTQMs,3603
72
72
  runtime/context/__init__.py,sha256=hg8ejm4bJy4tNkwmZ9lKgYJx6bU7OgOdBS684Uv5XGg,73
73
73
  runtime/context/context.py,sha256=pl_0x77_d5CiAznz1qGSk6o9cW-msNvlCt-2eFoMKlA,1739
@@ -85,15 +85,15 @@ runtime/run/__init__.py,sha256=zxMYVb7hn147YTrhMLsrcX6-KTd71HLrYHstJOWeWXQ,52
85
85
  runtime/run/intuned_settings.py,sha256=vy2-ktEzUfUp5Z90dp3l7jPKHNjgB-8GSMDgAY-rYaU,1074
86
86
  runtime/run/playwright_constructs.py,sha256=EIfnRlAi1k1wRiTT2OpPFVmrWwEeeiryuORibaLD1Xw,573
87
87
  runtime/run/pydantic_encoder.py,sha256=wJCljwwINSICvCJ0i2izp2RLkQ15nYglUQCyyjM40Jk,332
88
- runtime/run/run_api.py,sha256=iYekBi-mkBuBNvLIBXQ6RWvEDN7JhjSlX3i7a2td2P8,8952
88
+ runtime/run/run_api.py,sha256=vSf7kNmiUrmO4iXiqdLsZsNc0-vC8nm4r3HK2OAN0DY,8984
89
89
  runtime/run/traces.py,sha256=fKzh11LqV47ujgq_9I2tdp-dgld566wffWaHwU_4gis,1123
90
90
  runtime/types/__init__.py,sha256=IJkDfqsau8F8R_j8TO6j-JwW4ElQr6aU6LNaWRehg5U,401
91
91
  runtime/types/payload.py,sha256=sty8HgDEn3nJbZrwEOMCXyuG7_ICGDwlBIIWSON5ABY,124
92
92
  runtime/types/run_types.py,sha256=-j-XKXfRkzlyoW-Doe0og2jbqMMQWjOTIUqRFEc8lHA,4582
93
93
  runtime_helpers/__init__.py,sha256=XBrEiE9yNC8Lgn8NgIkqNXbI6e4ap237E83Zj_nlhCQ,249
94
94
  runtime_helpers/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
95
- intuned_runtime-1.1.1.dist-info/LICENSE,sha256=9LIjQdgyU_ptzNIfItNCR7VmEHqYnrY1f1XwOreKFI0,3714
96
- intuned_runtime-1.1.1.dist-info/METADATA,sha256=X7RhKRebpDcNZzUCoO4YvgAvToqPrh6UL8ad8ysB0l0,5299
97
- intuned_runtime-1.1.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
98
- intuned_runtime-1.1.1.dist-info/entry_points.txt,sha256=ToMS2cqDeRmF1FGkflwoeD-Xz6jJV5p1zIbw9G7IxMg,85
99
- intuned_runtime-1.1.1.dist-info/RECORD,,
95
+ intuned_runtime-1.1.3.dist-info/LICENSE,sha256=9LIjQdgyU_ptzNIfItNCR7VmEHqYnrY1f1XwOreKFI0,3714
96
+ intuned_runtime-1.1.3.dist-info/METADATA,sha256=TKO1oRYe4tlBXONrqGiMOlcyYjIwx74ZdKwAoNlkh9g,5299
97
+ intuned_runtime-1.1.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
98
+ intuned_runtime-1.1.3.dist-info/entry_points.txt,sha256=ToMS2cqDeRmF1FGkflwoeD-Xz6jJV5p1zIbw9G7IxMg,85
99
+ intuned_runtime-1.1.3.dist-info/RECORD,,
@@ -6,7 +6,6 @@ from typing import AsyncGenerator
6
6
  from typing import Tuple
7
7
 
8
8
  import anyio
9
- from camoufox.async_api import AsyncCamoufox
10
9
  from playwright.async_api import Browser
11
10
  from playwright.async_api import BrowserContext
12
11
  from playwright.async_api import Page
@@ -30,6 +29,8 @@ async def launch_camoufox(
30
29
  timeout: int = 10,
31
30
  **kwargs: Any,
32
31
  ) -> AsyncGenerator[Tuple[BrowserContext, Page], None]:
32
+ from camoufox.async_api import AsyncCamoufox
33
+
33
34
  dir = await create_user_dir()
34
35
  if kwargs.get("proxy") is None:
35
36
  proxy_env = get_proxy_env()
@@ -37,6 +38,7 @@ async def launch_camoufox(
37
38
  proxy_env = kwargs.get("proxy")
38
39
  kwargs.pop("proxy", None)
39
40
  async with AsyncCamoufox(
41
+ main_world_eval=True,
40
42
  headless=headless,
41
43
  config={"forceScopeAccess": True}, # required
42
44
  disable_coop=True,
@@ -69,16 +69,6 @@ async def create_user_dir_with_preferences():
69
69
  return await user_dir.absolute(), await playwright_temp_dir.absolute()
70
70
 
71
71
 
72
- extra_args = [
73
- "--no-first-run",
74
- "--disable-sync",
75
- "--disable-translate",
76
- "--disable-features=TranslateUI",
77
- "--disable-features=NetworkService",
78
- "--lang=en",
79
- "--disable-blink-features=AutomationControlled",
80
- ]
81
-
82
72
  default_user_agent = (
83
73
  "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
84
74
  )
@@ -94,6 +84,15 @@ async def launch_chromium(
94
84
  from playwright.async_api import async_playwright
95
85
  from playwright.async_api import Browser
96
86
 
87
+ extra_args = [
88
+ "--no-first-run",
89
+ "--disable-sync",
90
+ "--disable-translate",
91
+ "--disable-features=TranslateUI",
92
+ "--disable-features=NetworkService",
93
+ "--lang=en",
94
+ "--disable-blink-features=AutomationControlled",
95
+ ]
97
96
  async with async_playwright() as playwright:
98
97
  if cdp_address is not None:
99
98
  browser: Browser = await playwright.chromium.connect_over_cdp(cdp_address)
@@ -101,7 +100,10 @@ async def launch_chromium(
101
100
  user_preferences_dir = None
102
101
  dir_to_clean = None
103
102
  else:
104
- user_preferences_dir, dir_to_clean = await create_user_dir_with_preferences()
103
+ (
104
+ user_preferences_dir,
105
+ dir_to_clean,
106
+ ) = await create_user_dir_with_preferences()
105
107
  if kwargs.get("proxy") is None:
106
108
  proxy_env = get_proxy_env()
107
109
  else:
@@ -156,6 +158,15 @@ async def dangerous_launch_chromium(
156
158
  from playwright.async_api import async_playwright
157
159
  from playwright.async_api import Browser
158
160
 
161
+ extra_args = [
162
+ "--no-first-run",
163
+ "--disable-sync",
164
+ "--disable-translate",
165
+ "--disable-features=TranslateUI",
166
+ "--disable-features=NetworkService",
167
+ "--lang=en",
168
+ "--disable-blink-features=AutomationControlled",
169
+ ]
159
170
  playwright = await async_playwright().start()
160
171
  if cdp_url is not None:
161
172
  logging.info(f"Connecting to cdp: {cdp_url}")
runtime/run/run_api.py CHANGED
@@ -182,7 +182,7 @@ async def run_api(
182
182
  else:
183
183
  automation_result = await automation_coroutine_with_page(parameters.automation_function.params)
184
184
  try:
185
- json.dumps(automation_result, cls=PydanticEncoder)
185
+ automation_result = json.loads(json.dumps(automation_result, cls=PydanticEncoder))
186
186
  except TypeError as e:
187
187
  raise AutomationError(TypeError("Result is not JSON serializable")) from e
188
188