simplex 1.2.60__tar.gz → 1.2.62__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.

Potentially problematic release.


This version of simplex might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.60
3
+ Version: 1.2.62
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
@@ -22,7 +22,7 @@ class PostInstallCommand(install):
22
22
 
23
23
  setup(
24
24
  name="simplex",
25
- version="1.2.60",
25
+ version="1.2.62",
26
26
  packages=find_packages(),
27
27
  package_data={
28
28
  "simplex": ["browser_agent/dom/*.js"], # Include JS files in the dom directory
@@ -17,7 +17,7 @@ except ImportError:
17
17
  ImportWarning
18
18
  )
19
19
 
20
- # BASE_URL = "https://simplex-dev--api-server-fastapi-app.modal.run"
20
+ #BASE_URL = "https://simplex-dev--api-server-fastapi-app.modal.run"
21
21
  BASE_URL = "https://api.simplex.sh"
22
22
  class Playwright:
23
23
  def __init__(self, simplex_instance):
@@ -81,7 +81,6 @@ class Simplex:
81
81
  self.pw = None
82
82
 
83
83
  def close_session(self):
84
- time.sleep(30)
85
84
  if PLAYWRIGHT_AVAILABLE and self.pw_browser:
86
85
  try:
87
86
  self.pw_browser.close()
@@ -662,12 +661,18 @@ class Simplex:
662
661
  },
663
662
  data=data
664
663
  )
665
- if 'succeeded' not in response.json():
666
- raise ValueError(f"It looks like the click_and_download action failed to return a response. Did you set your api_key when creating the Simplex class?")
667
- if "succeeded" in response.json():
668
- return response.json()["b64"], response.json()["filename"]
664
+ # Get filename from Content-Disposition header
665
+ content_disposition = response.headers.get('Content-Disposition')
666
+ if content_disposition:
667
+ filename = content_disposition.split('filename=')[1].strip('"')
669
668
  else:
670
- raise ValueError(f"Failed to click and download: {response.json()['error']}")
669
+ raise ValueError("No filename found in Content-Disposition header. File was not downloaded.")
670
+
671
+ # Check if response content is empty
672
+ if len(response.content) == 0:
673
+ raise ValueError("Downloaded file is empty (0 bytes)")
674
+
675
+ return filename, response.content
671
676
 
672
677
  def exists(self, element_description: str, cdp_url: str = None):
673
678
  if not element_description or not element_description.strip():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.60
3
+ Version: 1.2.62
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
File without changes
File without changes
File without changes
File without changes
File without changes