webscout 8.2__py3-none-any.whl → 8.2.2__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.
@@ -21,4 +21,5 @@ from .toolbaz import *
21
21
  from .uncovrAI import *
22
22
  from .opkfc import *
23
23
  from .chatgpt import *
24
- from .textpollinations import *
24
+ from .textpollinations import *
25
+ from .e2b import *
@@ -13,8 +13,28 @@ from .utils import (
13
13
  get_system_prompt, get_last_user_message, format_prompt # Import format_prompt
14
14
  )
15
15
 
16
- # Import LitAgent for browser fingerprinting
17
- from webscout.litagent import LitAgent
16
+ # Attempt to import LitAgent, fallback if not available
17
+ try:
18
+ from webscout.litagent import LitAgent
19
+ except ImportError:
20
+ # Define a dummy LitAgent if webscout is not installed or accessible
21
+ class LitAgent:
22
+ def generate_fingerprint(self, browser: str = "chrome") -> Dict[str, Any]:
23
+ # Return minimal default headers if LitAgent is unavailable
24
+ print("Warning: LitAgent not found. Using default minimal headers.")
25
+ return {
26
+ "accept": "*/*",
27
+ "accept_language": "en-US,en;q=0.9",
28
+ "platform": "Windows",
29
+ "sec_ch_ua": '"Not/A)Brand";v="99", "Google Chrome";v="127", "Chromium";v="127"',
30
+ "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
31
+ "browser_type": browser,
32
+ }
33
+ def random(self) -> str:
34
+ # Return a default user agent if LitAgent is unavailable
35
+ print("Warning: LitAgent not found. Using default user agent.")
36
+ return "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
37
+
18
38
 
19
39
  class Completions(BaseCompletions):
20
40
  def __init__(self, client: 'C4AI'):
@@ -15,19 +15,7 @@ from .utils import (
15
15
  try:
16
16
  from webscout.litagent import LitAgent
17
17
  except ImportError:
18
- # Define a dummy LitAgent if webscout is not installed or accessible
19
- class LitAgent:
20
- def generate_fingerprint(self, browser: str = "chrome") -> Dict[str, Any]:
21
- # Return minimal default headers if LitAgent is unavailable
22
- print("Warning: LitAgent not found. Using default minimal headers.")
23
- return {
24
- "accept": "*/*",
25
- "accept_language": "en-US,en;q=0.9",
26
- "platform": "Windows",
27
- "sec_ch_ua": '"Not/A)Brand";v="99", "Google Chrome";v="127", "Chromium";v="127"',
28
- "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
29
- "browser_type": browser,
30
- }
18
+ pass
31
19
 
32
20
  # --- DeepInfra Client ---
33
21