webscout 6.4__py3-none-any.whl → 6.6__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.
- webscout/AIutel.py +7 -54
- webscout/DWEBS.py +48 -26
- webscout/{YTdownloader.py → Extra/YTToolkit/YTdownloader.py} +990 -1103
- webscout/Extra/YTToolkit/__init__.py +3 -0
- webscout/{transcriber.py → Extra/YTToolkit/transcriber.py} +1 -1
- webscout/Extra/YTToolkit/ytapi/__init__.py +6 -0
- webscout/Extra/YTToolkit/ytapi/channel.py +307 -0
- webscout/Extra/YTToolkit/ytapi/errors.py +13 -0
- webscout/Extra/YTToolkit/ytapi/extras.py +45 -0
- webscout/Extra/YTToolkit/ytapi/https.py +88 -0
- webscout/Extra/YTToolkit/ytapi/patterns.py +61 -0
- webscout/Extra/YTToolkit/ytapi/playlist.py +59 -0
- webscout/Extra/YTToolkit/ytapi/pool.py +8 -0
- webscout/Extra/YTToolkit/ytapi/query.py +37 -0
- webscout/Extra/YTToolkit/ytapi/stream.py +60 -0
- webscout/Extra/YTToolkit/ytapi/utils.py +62 -0
- webscout/Extra/YTToolkit/ytapi/video.py +102 -0
- webscout/Extra/__init__.py +2 -1
- webscout/Extra/autocoder/autocoder_utiles.py +119 -101
- webscout/Extra/autocoder/rawdog.py +679 -680
- webscout/Extra/gguf.py +441 -441
- webscout/Extra/markdownlite/__init__.py +862 -0
- webscout/Extra/weather_ascii.py +2 -2
- webscout/Provider/AISEARCH/__init__.py +2 -0
- webscout/Provider/AISEARCH/ooai.py +155 -0
- webscout/Provider/Amigo.py +70 -85
- webscout/Provider/{prefind.py → Jadve.py} +72 -70
- webscout/Provider/Netwrck.py +235 -0
- webscout/Provider/Openai.py +4 -3
- webscout/Provider/PI.py +292 -221
- webscout/Provider/PizzaGPT.py +3 -3
- webscout/Provider/Reka.py +0 -1
- webscout/Provider/TTS/__init__.py +5 -1
- webscout/Provider/TTS/deepgram.py +183 -0
- webscout/Provider/TTS/elevenlabs.py +137 -0
- webscout/Provider/TTS/gesserit.py +151 -0
- webscout/Provider/TTS/murfai.py +139 -0
- webscout/Provider/TTS/parler.py +134 -107
- webscout/Provider/TTS/streamElements.py +360 -275
- webscout/Provider/TTS/utils.py +280 -0
- webscout/Provider/TTS/voicepod.py +116 -116
- webscout/Provider/TeachAnything.py +15 -2
- webscout/Provider/Youchat.py +42 -8
- webscout/Provider/__init__.py +8 -21
- webscout/Provider/meta.py +794 -779
- webscout/Provider/multichat.py +230 -0
- webscout/Provider/promptrefine.py +2 -2
- webscout/Provider/talkai.py +10 -13
- webscout/Provider/turboseek.py +5 -4
- webscout/Provider/tutorai.py +8 -112
- webscout/Provider/typegpt.py +5 -7
- webscout/Provider/x0gpt.py +81 -9
- webscout/Provider/yep.py +123 -361
- webscout/__init__.py +33 -28
- webscout/conversation.py +24 -9
- webscout/exceptions.py +188 -20
- webscout/litprinter/__init__.py +719 -831
- webscout/litprinter/colors.py +54 -0
- webscout/optimizers.py +420 -270
- webscout/prompt_manager.py +279 -279
- webscout/scout/__init__.py +8 -0
- webscout/scout/core/__init__.py +7 -0
- webscout/scout/core/crawler.py +140 -0
- webscout/scout/core/scout.py +571 -0
- webscout/scout/core/search_result.py +96 -0
- webscout/scout/core/text_analyzer.py +63 -0
- webscout/scout/core/text_utils.py +277 -0
- webscout/scout/core/web_analyzer.py +52 -0
- webscout/scout/core.py +884 -0
- webscout/scout/element.py +460 -0
- webscout/scout/parsers/__init__.py +69 -0
- webscout/scout/parsers/html5lib_parser.py +172 -0
- webscout/scout/parsers/html_parser.py +236 -0
- webscout/scout/parsers/lxml_parser.py +178 -0
- webscout/scout/utils.py +38 -0
- webscout/update_checker.py +184 -125
- webscout/version.py +1 -1
- webscout/zeroart/__init__.py +55 -0
- webscout/zeroart/base.py +60 -0
- webscout/zeroart/effects.py +99 -0
- webscout/zeroart/fonts.py +816 -0
- webscout/zerodir/__init__.py +225 -0
- {webscout-6.4.dist-info → webscout-6.6.dist-info}/METADATA +18 -231
- webscout-6.6.dist-info/RECORD +197 -0
- webscout-6.6.dist-info/top_level.txt +2 -0
- webstoken/__init__.py +30 -0
- webstoken/classifier.py +189 -0
- webstoken/keywords.py +216 -0
- webstoken/language.py +128 -0
- webstoken/ner.py +164 -0
- webstoken/normalizer.py +35 -0
- webstoken/processor.py +77 -0
- webstoken/sentiment.py +206 -0
- webstoken/stemmer.py +73 -0
- webstoken/t.py +75 -0
- webstoken/tagger.py +60 -0
- webstoken/tokenizer.py +158 -0
- webscout/Agents/Onlinesearcher.py +0 -182
- webscout/Agents/__init__.py +0 -2
- webscout/Agents/functioncall.py +0 -248
- webscout/Bing_search.py +0 -251
- webscout/Provider/Perplexity.py +0 -599
- webscout/Provider/RoboCoders.py +0 -206
- webscout/Provider/genspark.py +0 -225
- webscout/Provider/perplexitylabs.py +0 -265
- webscout/Provider/twitterclone.py +0 -251
- webscout/Provider/upstage.py +0 -230
- webscout/gpt4free.py +0 -666
- webscout/requestsHTMLfix.py +0 -775
- webscout/webai.py +0 -2590
- webscout-6.4.dist-info/RECORD +0 -154
- webscout-6.4.dist-info/top_level.txt +0 -1
- /webscout/Provider/{felo_search.py → AISEARCH/felo_search.py} +0 -0
- {webscout-6.4.dist-info → webscout-6.6.dist-info}/LICENSE.md +0 -0
- {webscout-6.4.dist-info → webscout-6.6.dist-info}/WHEEL +0 -0
- {webscout-6.4.dist-info → webscout-6.6.dist-info}/entry_points.txt +0 -0
webscout/AIutel.py
CHANGED
|
@@ -5,14 +5,11 @@ import subprocess
|
|
|
5
5
|
import logging
|
|
6
6
|
import threading
|
|
7
7
|
import time
|
|
8
|
-
import appdirs
|
|
9
8
|
import datetime
|
|
10
9
|
import re
|
|
11
10
|
import sys
|
|
12
|
-
import click
|
|
13
11
|
from rich.markdown import Markdown
|
|
14
12
|
from rich.console import Console
|
|
15
|
-
import g4f
|
|
16
13
|
from typing import List, Tuple, Union
|
|
17
14
|
from typing import NoReturn
|
|
18
15
|
import requests
|
|
@@ -21,49 +18,9 @@ from playsound import playsound
|
|
|
21
18
|
from time import sleep as wait
|
|
22
19
|
import pathlib
|
|
23
20
|
import urllib.parse
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if not os.path.exists(default_path):
|
|
29
|
-
os.makedirs(default_path)
|
|
30
|
-
webai = [
|
|
31
|
-
"leo",
|
|
32
|
-
"openai",
|
|
33
|
-
"opengpt",
|
|
34
|
-
"koboldai",
|
|
35
|
-
"gemini",
|
|
36
|
-
"phind",
|
|
37
|
-
"blackboxai",
|
|
38
|
-
"g4fauto",
|
|
39
|
-
"perplexity",
|
|
40
|
-
"groq",
|
|
41
|
-
"reka",
|
|
42
|
-
"cohere",
|
|
43
|
-
"yepchat",
|
|
44
|
-
"you",
|
|
45
|
-
"xjai",
|
|
46
|
-
"thinkany",
|
|
47
|
-
"berlin4h",
|
|
48
|
-
"chatgptuk",
|
|
49
|
-
"auto",
|
|
50
|
-
"poe",
|
|
51
|
-
"basedgpt",
|
|
52
|
-
"deepseek",
|
|
53
|
-
"deepinfra",
|
|
54
|
-
"vtlchat",
|
|
55
|
-
"geminiflash",
|
|
56
|
-
"geminipro",
|
|
57
|
-
"ollama",
|
|
58
|
-
"andi",
|
|
59
|
-
"llama3"
|
|
60
|
-
]
|
|
61
|
-
|
|
62
|
-
gpt4free_providers = [
|
|
63
|
-
provider.__name__ for provider in g4f.Provider.__providers__ # if provider.working
|
|
64
|
-
]
|
|
65
|
-
|
|
66
|
-
available_providers = webai + gpt4free_providers
|
|
21
|
+
|
|
22
|
+
default_path = os.path.join(os.path.expanduser("~"), ".cache", "AIWEBS", "webscout")
|
|
23
|
+
|
|
67
24
|
def sanitize_stream(
|
|
68
25
|
chunk: str, intro_value: str = "data:", to_json: bool = True
|
|
69
26
|
) -> str | dict:
|
|
@@ -109,14 +66,10 @@ def run_system_command(
|
|
|
109
66
|
)
|
|
110
67
|
return (True, result)
|
|
111
68
|
except subprocess.CalledProcessError as e:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if help is not None:
|
|
117
|
-
click.secho(help, fg="cyan")
|
|
118
|
-
sys.exit(e.returncode) if exit_on_error else None
|
|
119
|
-
return (False, e)
|
|
69
|
+
if exit_on_error:
|
|
70
|
+
raise Exception(f"Command failed with exit code {e.returncode}") from e
|
|
71
|
+
else:
|
|
72
|
+
return (False, e)
|
|
120
73
|
|
|
121
74
|
|
|
122
75
|
from .conversation import Conversation
|
webscout/DWEBS.py
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
from bs4 import BeautifulSoup
|
|
2
1
|
import requests
|
|
3
2
|
from typing import Dict, List, Optional, Union, Any
|
|
4
3
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
4
|
+
from webscout.scout import Scout
|
|
5
5
|
from urllib.parse import quote, urljoin
|
|
6
|
+
from webscout.litagent import LitAgent
|
|
6
7
|
|
|
7
8
|
import time
|
|
8
9
|
import random
|
|
@@ -10,14 +11,13 @@ import json
|
|
|
10
11
|
import os
|
|
11
12
|
from datetime import datetime, timedelta
|
|
12
13
|
from functools import lru_cache
|
|
13
|
-
from .Litlogger import LitLogger, LogFormat, ColorScheme
|
|
14
|
-
from tenacity import retry, stop_after_attempt, wait_exponential
|
|
14
|
+
from webscout.Litlogger import LitLogger, LogFormat, ColorScheme
|
|
15
15
|
|
|
16
16
|
class GoogleS:
|
|
17
|
-
"""A Python interface for Google search with advanced features
|
|
17
|
+
"""A Python interface for Google search with advanced features
|
|
18
18
|
|
|
19
19
|
The GoogleS class provides a powerful interface to perform web searches, image searches,
|
|
20
|
-
and advanced filtering on Google. Built with love by HAI to keep it
|
|
20
|
+
and advanced filtering on Google. Built with love by HAI to keep it
|
|
21
21
|
|
|
22
22
|
Basic Usage:
|
|
23
23
|
>>> from webscout.DWEBS import GoogleS
|
|
@@ -122,7 +122,7 @@ class GoogleS:
|
|
|
122
122
|
"""
|
|
123
123
|
self.proxy = proxy
|
|
124
124
|
self.headers = headers if headers else {
|
|
125
|
-
"User-Agent":
|
|
125
|
+
"User-Agent": LitAgent().random() # Use LitAgent to generate user agent
|
|
126
126
|
}
|
|
127
127
|
self.headers["Referer"] = "https://www.google.com/"
|
|
128
128
|
self.client = requests.Session()
|
|
@@ -155,25 +155,46 @@ class GoogleS:
|
|
|
155
155
|
time.sleep(self.rate_limit - time_since_last)
|
|
156
156
|
self.last_request_time = time.time()
|
|
157
157
|
|
|
158
|
-
@retry(stop=stop_after_attempt(3), wait=wait_exponential(multiplier=1, min=4, max=10))
|
|
159
158
|
def _get_url(self, method: str, url: str, params: Optional[Dict[str, str]] = None,
|
|
160
|
-
data: Optional[Union[Dict[str, str], bytes]] = None) -> bytes:
|
|
159
|
+
data: Optional[Union[Dict[str, str], bytes]] = None, max_retries: int = 3) -> bytes:
|
|
161
160
|
"""
|
|
162
|
-
Makes an HTTP request with retry logic and rate limiting.
|
|
161
|
+
Makes an HTTP request with manual retry logic and rate limiting.
|
|
162
|
+
|
|
163
|
+
Args:
|
|
164
|
+
method (str): HTTP method (GET, POST, etc.)
|
|
165
|
+
url (str): Target URL
|
|
166
|
+
params (Optional[Dict[str, str]]): Query parameters
|
|
167
|
+
data (Optional[Union[Dict[str, str], bytes]]): Request payload
|
|
168
|
+
max_retries (int): Maximum number of retry attempts
|
|
169
|
+
|
|
170
|
+
Returns:
|
|
171
|
+
bytes: Response content
|
|
163
172
|
"""
|
|
164
173
|
self._respect_rate_limit()
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
self.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
|
|
175
|
+
for attempt in range(max_retries):
|
|
176
|
+
try:
|
|
177
|
+
if self.use_litlogger:
|
|
178
|
+
self.logger.debug(f"Making {method} request to {url} (Attempt {attempt + 1})")
|
|
179
|
+
|
|
180
|
+
resp = self.client.request(method, url, params=params, data=data, timeout=self.timeout)
|
|
181
|
+
resp.raise_for_status()
|
|
182
|
+
|
|
183
|
+
if self.use_litlogger:
|
|
184
|
+
self.logger.success(f"Request successful: {resp.status_code}")
|
|
185
|
+
|
|
186
|
+
return resp.content
|
|
187
|
+
|
|
188
|
+
except requests.exceptions.RequestException as ex:
|
|
189
|
+
if self.use_litlogger:
|
|
190
|
+
self.logger.error(f"Request failed: {url} - {str(ex)}")
|
|
191
|
+
|
|
192
|
+
# Exponential backoff
|
|
193
|
+
if attempt < max_retries - 1:
|
|
194
|
+
wait_time = (2 ** attempt) + random.random()
|
|
195
|
+
time.sleep(wait_time)
|
|
196
|
+
else:
|
|
197
|
+
raise
|
|
177
198
|
|
|
178
199
|
@lru_cache(maxsize=100)
|
|
179
200
|
def _cache_key(self, query: str, **kwargs) -> str:
|
|
@@ -217,7 +238,7 @@ class GoogleS:
|
|
|
217
238
|
type_filter: Optional[str] = None,
|
|
218
239
|
**kwargs
|
|
219
240
|
) -> List[Dict[str, str]]:
|
|
220
|
-
"""Search for images on Google with style!
|
|
241
|
+
"""Search for images on Google with style!
|
|
221
242
|
|
|
222
243
|
Args:
|
|
223
244
|
query (str): What you're looking for fam
|
|
@@ -270,7 +291,7 @@ class GoogleS:
|
|
|
270
291
|
params["tbs"] = f"itp:{type_filter}"
|
|
271
292
|
|
|
272
293
|
content = self._get_url("GET", self.SEARCH_TYPES["image"], params=params)
|
|
273
|
-
soup =
|
|
294
|
+
soup = Scout(content) # Use Scout parser
|
|
274
295
|
|
|
275
296
|
results = []
|
|
276
297
|
for img in soup.find_all("img", class_="rg_i"):
|
|
@@ -365,7 +386,8 @@ class GoogleS:
|
|
|
365
386
|
for future in as_completed(futures):
|
|
366
387
|
try:
|
|
367
388
|
resp_content = future.result()
|
|
368
|
-
soup =
|
|
389
|
+
soup = Scout(resp_content) # Use Scout parser
|
|
390
|
+
|
|
369
391
|
result_blocks = soup.find_all("div", class_="g")
|
|
370
392
|
|
|
371
393
|
if not result_blocks:
|
|
@@ -429,9 +451,9 @@ class GoogleS:
|
|
|
429
451
|
|
|
430
452
|
def _extract_text_from_webpage(self, html_content: bytes, max_characters: Optional[int] = None) -> str:
|
|
431
453
|
"""
|
|
432
|
-
Extracts visible text from HTML content using
|
|
454
|
+
Extracts visible text from HTML content using Scout parser.
|
|
433
455
|
"""
|
|
434
|
-
soup =
|
|
456
|
+
soup = Scout(html_content) # Use Scout parser
|
|
435
457
|
for tag in soup(["script", "style", "header", "footer", "nav"]):
|
|
436
458
|
tag.extract()
|
|
437
459
|
visible_text = soup.get_text(strip=True)
|