simplex 1.2.61__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.61
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.61",
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):
@@ -661,12 +661,18 @@ class Simplex:
661
661
  },
662
662
  data=data
663
663
  )
664
- if 'succeeded' not in response.json():
665
- 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?")
666
- if "succeeded" in response.json():
667
- 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('"')
668
668
  else:
669
- 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
670
676
 
671
677
  def exists(self, element_description: str, cdp_url: str = None):
672
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.61
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