firecrawl 1.6.0__tar.gz → 1.6.1__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 firecrawl might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: firecrawl
3
- Version: 1.6.0
3
+ Version: 1.6.1
4
4
  Summary: Python SDK for Firecrawl API
5
5
  Home-page: https://github.com/mendableai/firecrawl
6
6
  Author: Mendable.ai
@@ -13,7 +13,7 @@ import os
13
13
 
14
14
  from .firecrawl import FirecrawlApp # noqa
15
15
 
16
- __version__ = "1.6.0"
16
+ __version__ = "1.6.1"
17
17
 
18
18
  # Define the logger for the Firecrawl project
19
19
  logger: logging.Logger = logging.getLogger("firecrawl")
@@ -39,13 +39,6 @@ class FirecrawlApp:
39
39
  data: Optional[Any] = None
40
40
  error: Optional[str] = None
41
41
 
42
- class ErrorResponse(pydantic.BaseModel):
43
- """
44
- Error response.
45
- """
46
- success: bool
47
- error: str
48
-
49
42
  def __init__(self, api_key: Optional[str] = None, api_url: Optional[str] = None) -> None:
50
43
  """
51
44
  Initialize the FirecrawlApp instance with API key, API URL.
@@ -460,7 +453,7 @@ class FirecrawlApp:
460
453
  self._handle_error(response, 'check batch scrape status')
461
454
 
462
455
 
463
- def extract(self, urls: List[str], params: Optional[ExtractParams] = None) -> Union[ExtractResponse, ErrorResponse]:
456
+ def extract(self, urls: List[str], params: Optional[ExtractParams] = None) -> Any:
464
457
  """
465
458
  Extracts information from a URL using the Firecrawl API.
466
459
 
@@ -493,7 +486,11 @@ class FirecrawlApp:
493
486
  headers
494
487
  )
495
488
  if response.status_code == 200:
496
- return response.json()
489
+ data = response.json()
490
+ if data['success']:
491
+ return data
492
+ else:
493
+ raise Exception(f'Failed to extract. Error: {data["error"]}')
497
494
  else:
498
495
  self._handle_error(response, "extract")
499
496
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: firecrawl
3
- Version: 1.6.0
3
+ Version: 1.6.1
4
4
  Summary: Python SDK for Firecrawl API
5
5
  Home-page: https://github.com/mendableai/firecrawl
6
6
  Author: Mendable.ai
File without changes
File without changes
File without changes
File without changes
File without changes