simplex 1.2.41__py3-none-any.whl → 1.2.43__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 simplex might be problematic. Click here for more details.

simplex/cli.py CHANGED
@@ -47,9 +47,8 @@ def run(directory):
47
47
 
48
48
  @cli.command()
49
49
  @click.argument('website')
50
- @click.option('--proxies', type=bool, default=True, help='Enable proxy support (default: True)')
51
- def login(website, proxies):
52
- """Capture login session for a website"""
50
+ def login(website):
51
+ """Capture login session for a website. See https://simplex.sh/docs/getting-started for more information."""
53
52
  try:
54
53
  # Initialize Simplex with API key from environment
55
54
  api_key = os.getenv("SIMPLEX_API_KEY")
simplex/simplex.py CHANGED
@@ -59,10 +59,24 @@ class Simplex:
59
59
  self.api_key = api_key
60
60
  self.session_id = None
61
61
  atexit.register(self.close_session)
62
-
63
62
  self.playwright = Playwright(self)
64
-
63
+ self.pw_browser = None
64
+ self.pw = None
65
+
65
66
  def close_session(self):
67
+ try:
68
+ if self.pw_browser:
69
+ try:
70
+ self.pw_browser.close()
71
+ self.pw_browser = None
72
+ except Exception as e:
73
+ print(f"Failed to close pw_browser: {e}")
74
+ if self.pw:
75
+ try:
76
+ self.pw.stop()
77
+ self.pw = None
78
+ except Exception as e:
79
+ print(f"Failed to stop pw: {e}")
66
80
  if not self.session_id:
67
81
  return
68
82
  response = requests.post(
@@ -119,6 +133,10 @@ class Simplex:
119
133
  raise ValueError(f"It looks like the session wasn't created successfully. Did you set your api_key when creating the Simplex class?")
120
134
  self.session_id = response_json['session_id']
121
135
  livestream_url = response_json['livestream_url']
136
+
137
+ # Start Playwright without using context manager
138
+ self.pw = sync_playwright().start()
139
+ self.pw_browser = self.pw.chromium.connect_over_cdp(response_json['connect_url'])
122
140
 
123
141
  if show_in_console:
124
142
  print(f"Livestream URL: {livestream_url}")
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.41
3
+ Version: 1.2.43
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
@@ -18,6 +18,15 @@ Requires-Dist: requests
18
18
  Requires-Dist: python-dotenv
19
19
  Requires-Dist: click
20
20
  Requires-Dist: playwright
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: home-page
27
+ Dynamic: requires-dist
28
+ Dynamic: requires-python
29
+ Dynamic: summary
21
30
 
22
31
  # Simplex AI Python SDK
23
32
 
@@ -0,0 +1,11 @@
1
+ simplex/__init__.py,sha256=L_5i__xt_ZDkr6e-Wx9cr84t9sXpioOT7j01NJYJCTE,75
2
+ simplex/cli.py,sha256=0K_pzoVdF7vfTJPUONhFzzTvjZk2M7FZPpEONjZWJC8,2268
3
+ simplex/simplex.py,sha256=PM1YHCAjX1X-pJ_loRI7xAiPwcF7djVqUPquKWJeG30,23456
4
+ simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
5
+ simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
6
+ simplex-1.2.43.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
7
+ simplex-1.2.43.dist-info/METADATA,sha256=xD_SzK6Qb-3NSQMMSdOvesRonWkQxQ3nvbSFpQePAEA,964
8
+ simplex-1.2.43.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
+ simplex-1.2.43.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
10
+ simplex-1.2.43.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
11
+ simplex-1.2.43.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.1.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,11 +0,0 @@
1
- simplex/__init__.py,sha256=L_5i__xt_ZDkr6e-Wx9cr84t9sXpioOT7j01NJYJCTE,75
2
- simplex/cli.py,sha256=FcnZtxstZQS8bOshgT_RBSbEfCY2UkDU7FGBLZNmwAY,2307
3
- simplex/simplex.py,sha256=NHFOokIA7GYmbJ0J-Ul-qf3aVM3xa5frQN-9MV9GoYw,22758
4
- simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
5
- simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
6
- simplex-1.2.41.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
7
- simplex-1.2.41.dist-info/METADATA,sha256=Tt9Pd3kbyxQO0JjMLtzrNIv6i47YolrqvT-lKKioZBI,767
8
- simplex-1.2.41.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
9
- simplex-1.2.41.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
10
- simplex-1.2.41.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
11
- simplex-1.2.41.dist-info/RECORD,,