webscout 8.2.3__py3-none-any.whl → 8.2.4__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 webscout might be problematic. Click here for more details.
- inferno/lol.py +589 -0
- webscout/AIutel.py +226 -14
- webscout/Bard.py +579 -206
- webscout/DWEBS.py +78 -35
- webscout/Extra/tempmail/base.py +1 -1
- webscout/Provider/AISEARCH/hika_search.py +4 -0
- webscout/Provider/AllenAI.py +163 -126
- webscout/Provider/ChatGPTClone.py +96 -84
- webscout/Provider/Deepinfra.py +95 -67
- webscout/Provider/ElectronHub.py +55 -0
- webscout/Provider/GPTWeb.py +96 -46
- webscout/Provider/Groq.py +194 -91
- webscout/Provider/HeckAI.py +89 -47
- webscout/Provider/HuggingFaceChat.py +113 -106
- webscout/Provider/Hunyuan.py +94 -83
- webscout/Provider/Jadve.py +107 -75
- webscout/Provider/LambdaChat.py +106 -64
- webscout/Provider/Llama3.py +94 -39
- webscout/Provider/MCPCore.py +318 -0
- webscout/Provider/Marcus.py +85 -36
- webscout/Provider/Netwrck.py +76 -43
- webscout/Provider/OPENAI/__init__.py +4 -1
- webscout/Provider/OPENAI/ai4chat.py +286 -0
- webscout/Provider/OPENAI/chatgptclone.py +35 -14
- webscout/Provider/OPENAI/deepinfra.py +37 -0
- webscout/Provider/OPENAI/groq.py +354 -0
- webscout/Provider/OPENAI/heckai.py +6 -2
- webscout/Provider/OPENAI/mcpcore.py +376 -0
- webscout/Provider/OPENAI/multichat.py +368 -0
- webscout/Provider/OPENAI/netwrck.py +3 -1
- webscout/Provider/OpenGPT.py +48 -38
- webscout/Provider/PI.py +168 -92
- webscout/Provider/PizzaGPT.py +66 -36
- webscout/Provider/TeachAnything.py +85 -51
- webscout/Provider/TextPollinationsAI.py +109 -51
- webscout/Provider/TwoAI.py +109 -60
- webscout/Provider/Venice.py +93 -56
- webscout/Provider/VercelAI.py +2 -2
- webscout/Provider/WiseCat.py +65 -28
- webscout/Provider/Writecream.py +37 -11
- webscout/Provider/WritingMate.py +135 -63
- webscout/Provider/__init__.py +3 -21
- webscout/Provider/ai4chat.py +6 -7
- webscout/Provider/copilot.py +0 -3
- webscout/Provider/elmo.py +101 -58
- webscout/Provider/granite.py +91 -46
- webscout/Provider/hermes.py +87 -47
- webscout/Provider/koala.py +1 -1
- webscout/Provider/learnfastai.py +104 -50
- webscout/Provider/llama3mitril.py +86 -51
- webscout/Provider/llmchat.py +88 -46
- webscout/Provider/llmchatco.py +74 -49
- webscout/Provider/meta.py +41 -37
- webscout/Provider/multichat.py +54 -25
- webscout/Provider/scnet.py +93 -43
- webscout/Provider/searchchat.py +82 -75
- webscout/Provider/sonus.py +103 -51
- webscout/Provider/toolbaz.py +132 -77
- webscout/Provider/turboseek.py +92 -41
- webscout/Provider/tutorai.py +82 -64
- webscout/Provider/typefully.py +75 -33
- webscout/Provider/typegpt.py +96 -35
- webscout/Provider/uncovr.py +112 -62
- webscout/Provider/x0gpt.py +69 -26
- webscout/Provider/yep.py +79 -66
- webscout/conversation.py +35 -21
- webscout/exceptions.py +20 -0
- webscout/prompt_manager.py +56 -42
- webscout/version.py +1 -1
- webscout/webscout_search.py +65 -47
- webscout/webscout_search_async.py +81 -126
- webscout/yep_search.py +93 -43
- {webscout-8.2.3.dist-info → webscout-8.2.4.dist-info}/METADATA +22 -10
- {webscout-8.2.3.dist-info → webscout-8.2.4.dist-info}/RECORD +78 -81
- {webscout-8.2.3.dist-info → webscout-8.2.4.dist-info}/WHEEL +1 -1
- webscout/Provider/C4ai.py +0 -432
- webscout/Provider/ChatGPTES.py +0 -237
- webscout/Provider/DeepSeek.py +0 -196
- webscout/Provider/Llama.py +0 -200
- webscout/Provider/Phind.py +0 -535
- webscout/Provider/WebSim.py +0 -228
- webscout/Provider/labyrinth.py +0 -340
- webscout/Provider/lepton.py +0 -194
- webscout/Provider/llamatutor.py +0 -192
- {webscout-8.2.3.dist-info → webscout-8.2.4.dist-info}/entry_points.txt +0 -0
- {webscout-8.2.3.dist-info → webscout-8.2.4.dist-info/licenses}/LICENSE.md +0 -0
- {webscout-8.2.3.dist-info → webscout-8.2.4.dist-info}/top_level.txt +0 -0
webscout/DWEBS.py
CHANGED
|
@@ -4,7 +4,7 @@ DWEBS - A Google search library with advanced features
|
|
|
4
4
|
import random
|
|
5
5
|
from time import sleep
|
|
6
6
|
from webscout.scout import Scout
|
|
7
|
-
from requests import
|
|
7
|
+
from curl_cffi.requests import Session
|
|
8
8
|
from urllib.parse import unquote, urlencode
|
|
9
9
|
from typing import List, Dict, Optional, Union, Iterator, Any
|
|
10
10
|
from concurrent.futures import ThreadPoolExecutor
|
|
@@ -35,34 +35,55 @@ class SearchResult:
|
|
|
35
35
|
|
|
36
36
|
class GoogleSearch:
|
|
37
37
|
"""Google search implementation with configurable parameters and advanced features."""
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
_executor: ThreadPoolExecutor = ThreadPoolExecutor()
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
def __init__(
|
|
42
42
|
self,
|
|
43
43
|
timeout: int = 10,
|
|
44
44
|
proxies: Optional[Dict[str, str]] = None,
|
|
45
45
|
verify: bool = True,
|
|
46
46
|
lang: str = "en",
|
|
47
|
-
sleep_interval: float = 0.0
|
|
47
|
+
sleep_interval: float = 0.0,
|
|
48
|
+
impersonate: str = "chrome110"
|
|
48
49
|
):
|
|
49
50
|
"""
|
|
50
51
|
Initialize GoogleSearch with custom settings.
|
|
51
|
-
|
|
52
|
+
|
|
52
53
|
Args:
|
|
53
54
|
timeout: Request timeout in seconds
|
|
54
55
|
proxies: Proxy configuration for requests
|
|
55
56
|
verify: Whether to verify SSL certificates
|
|
56
57
|
lang: Search language
|
|
57
58
|
sleep_interval: Sleep time between pagination requests
|
|
59
|
+
impersonate: Browser profile for curl_cffi. Defaults to "chrome110".
|
|
58
60
|
"""
|
|
59
|
-
self.timeout = timeout
|
|
61
|
+
self.timeout = timeout # Keep timeout for potential non-session uses or reference
|
|
60
62
|
self.proxies = proxies if proxies else {}
|
|
61
63
|
self.verify = verify
|
|
62
64
|
self.lang = lang
|
|
63
65
|
self.sleep_interval = sleep_interval
|
|
64
66
|
self.base_url = "https://www.google.com/search"
|
|
65
|
-
|
|
67
|
+
# Initialize curl_cffi session
|
|
68
|
+
self.session = Session(
|
|
69
|
+
proxies=self.proxies,
|
|
70
|
+
verify=self.verify,
|
|
71
|
+
timeout=self.timeout,
|
|
72
|
+
impersonate=impersonate
|
|
73
|
+
)
|
|
74
|
+
# Set common headers for the session
|
|
75
|
+
self.session.headers = {
|
|
76
|
+
"User-Agent": self._get_useragent(),
|
|
77
|
+
"Accept-Language": self.lang,
|
|
78
|
+
"Accept-Encoding": "gzip, deflate, br",
|
|
79
|
+
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
|
|
80
|
+
}
|
|
81
|
+
# Set default cookies for the session
|
|
82
|
+
self.session.cookies.update({
|
|
83
|
+
'CONSENT': 'PENDING+987',
|
|
84
|
+
'SOCS': 'CAESHAgBEhIaAB',
|
|
85
|
+
})
|
|
86
|
+
|
|
66
87
|
def _get_useragent(self) -> str:
|
|
67
88
|
"""
|
|
68
89
|
Generate a random user agent string.
|
|
@@ -99,29 +120,23 @@ class GoogleSearch:
|
|
|
99
120
|
# Add search type if specified
|
|
100
121
|
if search_type:
|
|
101
122
|
params["tbm"] = search_type
|
|
102
|
-
|
|
123
|
+
|
|
103
124
|
try:
|
|
104
|
-
|
|
125
|
+
# Use the curl_cffi session
|
|
126
|
+
resp = self.session.get(
|
|
105
127
|
url=self.base_url,
|
|
106
|
-
headers={
|
|
107
|
-
"User-Agent": self._get_useragent(),
|
|
108
|
-
"Accept-Language": self.lang,
|
|
109
|
-
"Accept-Encoding": "gzip, deflate, br",
|
|
110
|
-
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
|
|
111
|
-
},
|
|
112
128
|
params=params,
|
|
113
|
-
|
|
114
|
-
timeout
|
|
115
|
-
verify=self.verify,
|
|
116
|
-
cookies={
|
|
117
|
-
'CONSENT': 'PENDING+987',
|
|
118
|
-
'SOCS': 'CAESHAgBEhIaAB',
|
|
119
|
-
}
|
|
129
|
+
# Headers and cookies are now part of the session
|
|
130
|
+
# proxies, timeout, verify are handled by the session
|
|
120
131
|
)
|
|
121
132
|
resp.raise_for_status()
|
|
122
133
|
return resp.text
|
|
123
134
|
except Exception as e:
|
|
124
|
-
|
|
135
|
+
# Provide more specific error context if possible
|
|
136
|
+
if hasattr(e, 'response') and e.response is not None:
|
|
137
|
+
raise RuntimeError(f"Search request failed with status {e.response.status_code}: {str(e)}")
|
|
138
|
+
else:
|
|
139
|
+
raise RuntimeError(f"Search request failed: {str(e)}")
|
|
125
140
|
|
|
126
141
|
def _extract_url(self, raw_link: str) -> Optional[str]:
|
|
127
142
|
"""
|
|
@@ -283,8 +298,15 @@ class GoogleSearch:
|
|
|
283
298
|
start = start_num
|
|
284
299
|
|
|
285
300
|
while len(fetched_results) < max_results:
|
|
301
|
+
# Add safe search parameter to the request
|
|
302
|
+
# Note: This modifies the session params for this specific request type
|
|
303
|
+
# It might be better to pass params directly to session.get if mixing search types
|
|
304
|
+
term_with_safe = f"{keywords} safe:{safe}"
|
|
305
|
+
if region and region.lower() != "all":
|
|
306
|
+
term_with_safe += f" location:{region}" # Example of adding region, adjust as needed
|
|
307
|
+
|
|
286
308
|
response_html = self._make_request(
|
|
287
|
-
term=
|
|
309
|
+
term=term_with_safe, # Pass term with safe search
|
|
288
310
|
results=max_results - len(fetched_results),
|
|
289
311
|
start=start
|
|
290
312
|
)
|
|
@@ -304,7 +326,7 @@ class GoogleSearch:
|
|
|
304
326
|
if len(fetched_results) >= max_results:
|
|
305
327
|
break
|
|
306
328
|
|
|
307
|
-
start += 10
|
|
329
|
+
start += 10 # Google typically uses increments of 10
|
|
308
330
|
sleep(self.sleep_interval)
|
|
309
331
|
|
|
310
332
|
return fetched_results[:max_results]
|
|
@@ -340,11 +362,15 @@ class GoogleSearch:
|
|
|
340
362
|
safe = safe_map.get(safesearch.lower(), "moderate")
|
|
341
363
|
|
|
342
364
|
# Keep track of unique results
|
|
343
|
-
fetched_results = []
|
|
344
365
|
fetched_links = set()
|
|
345
|
-
|
|
366
|
+
|
|
367
|
+
# Add safe search parameter
|
|
368
|
+
term_with_safe = f"{keywords} safe:{safe}"
|
|
369
|
+
if region and region.lower() != "all":
|
|
370
|
+
term_with_safe += f" location:{region}" # Example
|
|
371
|
+
|
|
346
372
|
response_html = self._make_request(
|
|
347
|
-
term=
|
|
373
|
+
term=term_with_safe, # Pass term with safe search
|
|
348
374
|
results=max_results,
|
|
349
375
|
search_type="nws"
|
|
350
376
|
)
|
|
@@ -353,7 +379,7 @@ class GoogleSearch:
|
|
|
353
379
|
html=response_html,
|
|
354
380
|
num_results=max_results,
|
|
355
381
|
fetched_links=fetched_links,
|
|
356
|
-
unique=True
|
|
382
|
+
unique=True # News results are generally unique per request
|
|
357
383
|
)
|
|
358
384
|
|
|
359
385
|
return results[:max_results]
|
|
@@ -384,17 +410,19 @@ class GoogleSearch:
|
|
|
384
410
|
|
|
385
411
|
url = f"https://www.google.com/complete/search?{urlencode(params)}"
|
|
386
412
|
|
|
413
|
+
# Use a simpler header set for the suggestions API
|
|
387
414
|
headers = {
|
|
388
415
|
"User-Agent": self._get_useragent(),
|
|
389
416
|
"Accept": "application/json, text/javascript, */*",
|
|
390
417
|
"Accept-Language": self.lang,
|
|
391
418
|
}
|
|
392
419
|
|
|
393
|
-
|
|
420
|
+
# Use session.get but override headers for this specific request
|
|
421
|
+
response = self.session.get(
|
|
394
422
|
url=url,
|
|
395
423
|
headers=headers,
|
|
396
|
-
|
|
397
|
-
verify
|
|
424
|
+
params=params # Pass params directly
|
|
425
|
+
# timeout and verify are handled by session
|
|
398
426
|
)
|
|
399
427
|
response.raise_for_status()
|
|
400
428
|
|
|
@@ -405,25 +433,40 @@ class GoogleSearch:
|
|
|
405
433
|
return []
|
|
406
434
|
|
|
407
435
|
except Exception as e:
|
|
436
|
+
# Provide more specific error context if possible
|
|
437
|
+
if hasattr(e, 'response') and e.response is not None:
|
|
438
|
+
# Log error or handle differently if needed
|
|
439
|
+
print(f"Suggestions request failed with status {e.response.status_code}: {str(e)}")
|
|
440
|
+
else:
|
|
441
|
+
print(f"Suggestions request failed: {str(e)}")
|
|
408
442
|
# Return empty list on error instead of raising exception
|
|
409
443
|
return []
|
|
410
444
|
|
|
411
445
|
|
|
412
446
|
# Legacy function support for backward compatibility
|
|
413
|
-
def search(term, num_results=10, lang="en", proxy=None, advanced=False, sleep_interval=0, timeout=5, safe="active", ssl_verify=True, region=None, start_num=0, unique=False):
|
|
447
|
+
def search(term, num_results=10, lang="en", proxy=None, advanced=False, sleep_interval=0, timeout=5, safe="active", ssl_verify=True, region=None, start_num=0, unique=False, impersonate="chrome110"): # Added impersonate
|
|
414
448
|
"""Legacy function for backward compatibility."""
|
|
415
449
|
google_search = GoogleSearch(
|
|
416
450
|
timeout=timeout,
|
|
417
451
|
proxies={"https": proxy, "http": proxy} if proxy else None,
|
|
418
452
|
verify=ssl_verify,
|
|
419
453
|
lang=lang,
|
|
420
|
-
sleep_interval=sleep_interval
|
|
454
|
+
sleep_interval=sleep_interval,
|
|
455
|
+
impersonate=impersonate # Pass impersonate
|
|
421
456
|
)
|
|
422
457
|
|
|
458
|
+
# Map legacy safe values
|
|
459
|
+
safe_search_map = {
|
|
460
|
+
"active": "on",
|
|
461
|
+
"moderate": "moderate",
|
|
462
|
+
"off": "off"
|
|
463
|
+
}
|
|
464
|
+
safesearch_val = safe_search_map.get(safe, "moderate")
|
|
465
|
+
|
|
423
466
|
results = google_search.text(
|
|
424
467
|
keywords=term,
|
|
425
468
|
region=region,
|
|
426
|
-
safesearch=
|
|
469
|
+
safesearch=safesearch_val,
|
|
427
470
|
max_results=num_results,
|
|
428
471
|
start_num=start_num,
|
|
429
472
|
unique=unique
|
webscout/Extra/tempmail/base.py
CHANGED
|
@@ -148,7 +148,7 @@ def get_random_email(provider_name: str = "mailtm") -> Tuple[str, TempMailProvid
|
|
|
148
148
|
except Exception as e:
|
|
149
149
|
raise RuntimeError(f"Failed to initialize provider: {e}")
|
|
150
150
|
|
|
151
|
-
# Create the account
|
|
151
|
+
# Create the account (auto-generates a random email)
|
|
152
152
|
success = provider.create_account()
|
|
153
153
|
if not success:
|
|
154
154
|
raise RuntimeError(f"Failed to create account with provider {provider_name}")
|
|
@@ -31,12 +31,15 @@ class Hika(AISearch):
|
|
|
31
31
|
timeout: int = 60,
|
|
32
32
|
proxies: Optional[dict] = None,
|
|
33
33
|
language: str = "en",
|
|
34
|
+
model: str = "deepseek-r1",
|
|
35
|
+
|
|
34
36
|
):
|
|
35
37
|
self.session = requests.Session()
|
|
36
38
|
self.base_url = "https://api.hika.fyi/api/"
|
|
37
39
|
self.endpoint = "kbase/web"
|
|
38
40
|
self.timeout = timeout
|
|
39
41
|
self.language = language
|
|
42
|
+
self.model = model
|
|
40
43
|
self.last_response = {}
|
|
41
44
|
|
|
42
45
|
self.headers = {
|
|
@@ -104,6 +107,7 @@ class Hika(AISearch):
|
|
|
104
107
|
# Prepare payload
|
|
105
108
|
payload = {
|
|
106
109
|
"keyword": prompt,
|
|
110
|
+
"model": self.model,
|
|
107
111
|
"language": self.language,
|
|
108
112
|
"stream": True # Always request streaming for consistent handling
|
|
109
113
|
}
|