webscout 6.6__py3-none-any.whl → 6.8__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/Extra/weather.py +5 -5
- webscout/Provider/Cloudflare.py +2 -1
- webscout/Provider/DARKAI.py +2 -2
- webscout/Provider/Free2GPT.py +5 -5
- webscout/Provider/Marcus.py +3 -3
- webscout/Provider/Netwrck.py +238 -234
- webscout/Provider/PI.py +113 -47
- webscout/Provider/Phind.py +6 -0
- webscout/Provider/PizzaGPT.py +62 -53
- webscout/Provider/RUBIKSAI.py +93 -38
- webscout/Provider/__init__.py +0 -6
- webscout/Provider/cleeai.py +2 -2
- webscout/Provider/elmo.py +2 -2
- webscout/Provider/gaurish.py +2 -2
- webscout/Provider/geminiprorealtime.py +2 -2
- webscout/Provider/lepton.py +2 -2
- webscout/Provider/llama3mitril.py +3 -3
- webscout/Provider/llamatutor.py +2 -2
- webscout/Provider/llmchat.py +3 -2
- webscout/Provider/meta.py +3 -3
- webscout/Provider/tutorai.py +1 -1
- webscout/cli.py +31 -39
- webscout/litprinter/__init__.py +16 -7
- webscout/version.py +1 -1
- webscout/webscout_search.py +1 -1
- {webscout-6.6.dist-info → webscout-6.8.dist-info}/METADATA +2 -8
- {webscout-6.6.dist-info → webscout-6.8.dist-info}/RECORD +31 -35
- {webscout-6.6.dist-info → webscout-6.8.dist-info}/entry_points.txt +1 -1
- webscout/Provider/Farfalle.py +0 -227
- webscout/Provider/NinjaChat.py +0 -200
- webscout/Provider/mhystical.py +0 -176
- webstoken/t.py +0 -75
- {webscout-6.6.dist-info → webscout-6.8.dist-info}/LICENSE.md +0 -0
- {webscout-6.6.dist-info → webscout-6.8.dist-info}/WHEEL +0 -0
- {webscout-6.6.dist-info → webscout-6.8.dist-info}/top_level.txt +0 -0
webscout/Provider/__init__.py
CHANGED
|
@@ -16,7 +16,6 @@ from .ai4chat import *
|
|
|
16
16
|
from .Gemini import GEMINI
|
|
17
17
|
from .Deepseek import DeepSeek
|
|
18
18
|
from .Deepinfra import DeepInfra
|
|
19
|
-
from .Farfalle import *
|
|
20
19
|
from .cleeai import *
|
|
21
20
|
from .OLLAMA import OLLAMA
|
|
22
21
|
from .Andi import AndiSearch
|
|
@@ -54,18 +53,15 @@ from .bagoodex import *
|
|
|
54
53
|
from .aimathgpt import *
|
|
55
54
|
from .gaurish import *
|
|
56
55
|
from .geminiprorealtime import *
|
|
57
|
-
from .NinjaChat import *
|
|
58
56
|
from .llmchat import *
|
|
59
57
|
from .talkai import *
|
|
60
58
|
from .askmyai import *
|
|
61
59
|
from .llama3mitril import *
|
|
62
60
|
from .Marcus import *
|
|
63
61
|
from .typegpt import *
|
|
64
|
-
from .mhystical import *
|
|
65
62
|
from .multichat import *
|
|
66
63
|
from .Jadve import *
|
|
67
64
|
__all__ = [
|
|
68
|
-
'Farfalle',
|
|
69
65
|
'LLAMA',
|
|
70
66
|
'Cohere',
|
|
71
67
|
'REKA',
|
|
@@ -121,13 +117,11 @@ __all__ = [
|
|
|
121
117
|
'AIMathGPT',
|
|
122
118
|
'GaurishCerebras',
|
|
123
119
|
'GeminiPro',
|
|
124
|
-
'NinjaChat',
|
|
125
120
|
'LLMChat',
|
|
126
121
|
'Talkai',
|
|
127
122
|
'Llama3Mitril',
|
|
128
123
|
'Marcus',
|
|
129
124
|
'TypeGPT',
|
|
130
|
-
'Mhystical',
|
|
131
125
|
'Netwrck',
|
|
132
126
|
'MultiChatAI',
|
|
133
127
|
'JadveOpenAI',
|
webscout/Provider/cleeai.py
CHANGED
|
@@ -6,7 +6,7 @@ from webscout.AIutel import Optimizers
|
|
|
6
6
|
from webscout.AIutel import Conversation
|
|
7
7
|
from webscout.AIutel import AwesomePrompts
|
|
8
8
|
from webscout.AIbase import Provider
|
|
9
|
-
|
|
9
|
+
import webscout
|
|
10
10
|
class Cleeai(Provider):
|
|
11
11
|
"""
|
|
12
12
|
A class to interact with the Cleeai.com API.
|
|
@@ -59,7 +59,7 @@ class Cleeai(Provider):
|
|
|
59
59
|
"sec-fetch-dest": "empty",
|
|
60
60
|
"sec-fetch-mode": "cors",
|
|
61
61
|
"sec-fetch-site": "same-site",
|
|
62
|
-
"user-agent":
|
|
62
|
+
"user-agent": webscout.LitAgent().random()
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
self.__available_optimizers = (
|
webscout/Provider/elmo.py
CHANGED
|
@@ -3,7 +3,7 @@ from webscout.AIutel import Optimizers
|
|
|
3
3
|
from webscout.AIutel import Conversation
|
|
4
4
|
from webscout.AIutel import AwesomePrompts
|
|
5
5
|
from webscout.AIbase import Provider
|
|
6
|
-
|
|
6
|
+
from webscout import LitAgent
|
|
7
7
|
|
|
8
8
|
class Elmo(Provider):
|
|
9
9
|
"""
|
|
@@ -62,7 +62,7 @@ class Elmo(Provider):
|
|
|
62
62
|
"sec-fetch-dest": "empty",
|
|
63
63
|
"sec-fetch-mode": "cors",
|
|
64
64
|
"sec-fetch-site": "cross-site",
|
|
65
|
-
"user-agent":
|
|
65
|
+
"user-agent": LitAgent().random(),
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
self.__available_optimizers = (
|
webscout/Provider/gaurish.py
CHANGED
|
@@ -10,7 +10,7 @@ from webscout.AIutel import AwesomePrompts, sanitize_stream
|
|
|
10
10
|
from webscout.AIbase import Provider, AsyncProvider
|
|
11
11
|
from webscout import exceptions
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
from webscout import LitAgent
|
|
14
14
|
class GaurishCerebras(Provider):
|
|
15
15
|
"""
|
|
16
16
|
A class to interact with the Gaurish Cerebras API.
|
|
@@ -65,7 +65,7 @@ class GaurishCerebras(Provider):
|
|
|
65
65
|
"sec-fetch-dest": "empty",
|
|
66
66
|
"sec-fetch-mode": "cors",
|
|
67
67
|
"sec-fetch-site": "same-site",
|
|
68
|
-
"user-agent":
|
|
68
|
+
"user-agent": LitAgent().random(),
|
|
69
69
|
"x-stainless-arch": "unknown",
|
|
70
70
|
"x-stainless-lang": "js",
|
|
71
71
|
"x-stainless-os": "Unknown",
|
|
@@ -9,7 +9,7 @@ from webscout.AIutel import Conversation
|
|
|
9
9
|
from webscout.AIutel import AwesomePrompts, sanitize_stream
|
|
10
10
|
from webscout.AIbase import Provider, AsyncProvider
|
|
11
11
|
from webscout import exceptions
|
|
12
|
-
|
|
12
|
+
from webscout import LitAgent
|
|
13
13
|
|
|
14
14
|
class GeminiPro(Provider):
|
|
15
15
|
"""
|
|
@@ -47,7 +47,7 @@ class GeminiPro(Provider):
|
|
|
47
47
|
'sec-fetch-dest': 'empty',
|
|
48
48
|
'sec-fetch-mode': 'cors',
|
|
49
49
|
'sec-fetch-site': 'same-origin',
|
|
50
|
-
'user-agent':
|
|
50
|
+
'user-agent': LitAgent().random(),
|
|
51
51
|
'x-requested-with': 'XMLHttpRequest'
|
|
52
52
|
}
|
|
53
53
|
self.session = requests.Session()
|
webscout/Provider/lepton.py
CHANGED
|
@@ -6,7 +6,7 @@ from webscout.AIutel import Optimizers
|
|
|
6
6
|
from webscout.AIutel import Conversation
|
|
7
7
|
from webscout.AIutel import AwesomePrompts
|
|
8
8
|
from webscout.AIbase import Provider
|
|
9
|
-
|
|
9
|
+
from webscout import LitAgent as Lit
|
|
10
10
|
class Lepton(Provider):
|
|
11
11
|
"""
|
|
12
12
|
A class to interact with the Lepton.run API.
|
|
@@ -58,7 +58,7 @@ class Lepton(Provider):
|
|
|
58
58
|
"sec-fetch-dest": "empty",
|
|
59
59
|
"sec-fetch-mode": "cors",
|
|
60
60
|
"sec-fetch-site": "same-origin",
|
|
61
|
-
"user-agent":
|
|
61
|
+
"user-agent": Lit().random(),
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
self.__available_optimizers = (
|
|
@@ -7,7 +7,7 @@ from webscout.AIutel import Conversation
|
|
|
7
7
|
from webscout.AIutel import AwesomePrompts
|
|
8
8
|
from webscout.AIbase import Provider
|
|
9
9
|
from webscout import exceptions
|
|
10
|
-
|
|
10
|
+
from webscout import LitAgent as Lit
|
|
11
11
|
|
|
12
12
|
class Llama3Mitril(Provider):
|
|
13
13
|
"""
|
|
@@ -40,7 +40,7 @@ class Llama3Mitril(Provider):
|
|
|
40
40
|
self.headers = {
|
|
41
41
|
"Content-Type": "application/json",
|
|
42
42
|
"DNT": "1",
|
|
43
|
-
"User-Agent":
|
|
43
|
+
"User-Agent": Lit().random(),
|
|
44
44
|
}
|
|
45
45
|
self.__available_optimizers = (
|
|
46
46
|
method
|
|
@@ -177,4 +177,4 @@ if __name__ == "__main__":
|
|
|
177
177
|
)
|
|
178
178
|
|
|
179
179
|
for response in ai.chat("Hello", stream=True):
|
|
180
|
-
print(response)
|
|
180
|
+
print(response, end="", flush=True)
|
webscout/Provider/llamatutor.py
CHANGED
|
@@ -6,7 +6,7 @@ from webscout.AIutel import Conversation
|
|
|
6
6
|
from webscout.AIutel import AwesomePrompts
|
|
7
7
|
from webscout.AIbase import Provider
|
|
8
8
|
from webscout import exceptions
|
|
9
|
-
|
|
9
|
+
from webscout import LitAgent as Lit
|
|
10
10
|
class LlamaTutor(Provider):
|
|
11
11
|
"""
|
|
12
12
|
A class to interact with the LlamaTutor API (Together.ai).
|
|
@@ -63,7 +63,7 @@ class LlamaTutor(Provider):
|
|
|
63
63
|
"Sec-Fetch-Dest": "empty",
|
|
64
64
|
"Sec-Fetch-Mode": "cors",
|
|
65
65
|
"Sec-Fetch-Site": "same-origin",
|
|
66
|
-
"User-Agent":
|
|
66
|
+
"User-Agent": Lit().random(),
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
self.__available_optimizers = (
|
webscout/Provider/llmchat.py
CHANGED
|
@@ -7,7 +7,7 @@ from webscout.AIutel import Conversation
|
|
|
7
7
|
from webscout.AIutel import AwesomePrompts
|
|
8
8
|
from webscout.AIbase import Provider
|
|
9
9
|
from webscout import exceptions
|
|
10
|
-
|
|
10
|
+
from webscout import LitAgent as Lit
|
|
11
11
|
class LLMChat(Provider):
|
|
12
12
|
"""
|
|
13
13
|
A class to interact with the LLMChat API.
|
|
@@ -18,6 +18,7 @@ class LLMChat(Provider):
|
|
|
18
18
|
"@cf/meta/llama-3.1-8b-instruct",
|
|
19
19
|
"@cf/meta/llama-3.2-3b-instruct",
|
|
20
20
|
"@cf/meta/llama-3.2-1b-instruct"
|
|
21
|
+
"@cf/meta/llama-3.3-70b-instruct-fp8-fast"
|
|
21
22
|
]
|
|
22
23
|
|
|
23
24
|
def __init__(
|
|
@@ -51,7 +52,7 @@ class LLMChat(Provider):
|
|
|
51
52
|
self.headers = {
|
|
52
53
|
"Content-Type": "application/json",
|
|
53
54
|
"Accept": "*/*",
|
|
54
|
-
"User-Agent":
|
|
55
|
+
"User-Agent": Lit().random(),
|
|
55
56
|
"Origin": "https://llmchat.in",
|
|
56
57
|
"Referer": "https://llmchat.in/"
|
|
57
58
|
}
|
webscout/Provider/meta.py
CHANGED
|
@@ -14,7 +14,7 @@ from webscout.AIutel import Conversation
|
|
|
14
14
|
from webscout.AIutel import AwesomePrompts, sanitize_stream
|
|
15
15
|
from webscout.AIbase import Provider
|
|
16
16
|
from webscout import exceptions
|
|
17
|
-
|
|
17
|
+
from webscout import LitAgent as Lit
|
|
18
18
|
MAX_RETRIES = 3
|
|
19
19
|
|
|
20
20
|
def generate_offline_threading_id() -> str:
|
|
@@ -103,7 +103,7 @@ def get_fb_session(email, password, proxies=None):
|
|
|
103
103
|
"sec-fetch-site": "none",
|
|
104
104
|
"sec-fetch-user": "?1",
|
|
105
105
|
"upgrade-insecure-requests": "1",
|
|
106
|
-
"user-agent":
|
|
106
|
+
"user-agent": Lit().random(),
|
|
107
107
|
}
|
|
108
108
|
# Send the GET request
|
|
109
109
|
response = requests.get(login_url, headers=headers, proxies=proxies)
|
|
@@ -248,7 +248,7 @@ def get_fb_session(email, password, proxies=None):
|
|
|
248
248
|
return cookies
|
|
249
249
|
|
|
250
250
|
|
|
251
|
-
def get_cookies() -> dict:
|
|
251
|
+
def get_cookies(self) -> dict:
|
|
252
252
|
"""
|
|
253
253
|
Extracts necessary cookies from the Meta AI main page.
|
|
254
254
|
|
webscout/Provider/tutorai.py
CHANGED
|
@@ -48,7 +48,7 @@ class TutorAI(Provider):
|
|
|
48
48
|
self.session = requests.Session()
|
|
49
49
|
self.is_conversation = is_conversation
|
|
50
50
|
self.max_tokens_to_sample = max_tokens
|
|
51
|
-
self.api_endpoint = "https://
|
|
51
|
+
self.api_endpoint = "https://ai-tutor.ai/api/generate-homeworkify-response"
|
|
52
52
|
self.stream_chunk_size = 1024
|
|
53
53
|
self.timeout = timeout
|
|
54
54
|
self.last_response = {}
|
webscout/cli.py
CHANGED
|
@@ -54,7 +54,7 @@ def _print_data(data):
|
|
|
54
54
|
console = Console()
|
|
55
55
|
if data:
|
|
56
56
|
for i, e in enumerate(data, start=1):
|
|
57
|
-
table = Table(show_header=False, show_lines=True, expand=True, box=None)
|
|
57
|
+
table = Table(show_header=False, show_lines=True, expand=True, box=None)
|
|
58
58
|
table.add_column("Key", style="cyan", no_wrap=True, width=15)
|
|
59
59
|
table.add_column("Value", style="white")
|
|
60
60
|
|
|
@@ -62,15 +62,14 @@ def _print_data(data):
|
|
|
62
62
|
if v:
|
|
63
63
|
width = 300 if k in ("content", "href", "image", "source", "thumbnail", "url") else 78
|
|
64
64
|
k = "language" if k == "detected_language" else k
|
|
65
|
-
text = Text(
|
|
66
|
-
text = text.wrap(width=width,
|
|
65
|
+
text = Text(str(v), style="white")
|
|
66
|
+
text = text.wrap(width=width, console=console)
|
|
67
67
|
else:
|
|
68
|
-
text = Text(v, style="white")
|
|
68
|
+
text = Text(str(v), style="white")
|
|
69
69
|
table.add_row(k, text)
|
|
70
70
|
|
|
71
|
-
# Only the Panel has the title now
|
|
72
71
|
console.print(Panel(table, title=f"Result {i}", expand=False, style="green on black"))
|
|
73
|
-
console.print("\n")
|
|
72
|
+
console.print("\n")
|
|
74
73
|
|
|
75
74
|
# Initialize CLI app
|
|
76
75
|
app = CLI(name="webscout", help="Search the web with a rich UI", version=__version__)
|
|
@@ -117,7 +116,7 @@ def chat(proxy: str = None, model: str = "gpt-4o-mini"):
|
|
|
117
116
|
console.print("\n[cyan]Chat session ended. Goodbye![/]")
|
|
118
117
|
|
|
119
118
|
@app.command()
|
|
120
|
-
@option("--keywords", "-k", help="Search keywords")
|
|
119
|
+
@option("--keywords", "-k", help="Search keywords", required=True)
|
|
121
120
|
@option("--region", "-r", help="Region for search results", default="wt-wt")
|
|
122
121
|
@option("--safesearch", "-s", help="SafeSearch setting", default="moderate")
|
|
123
122
|
@option("--timelimit", "-t", help="Time limit for results", default=None)
|
|
@@ -128,29 +127,27 @@ def text(keywords: str, region: str, safesearch: str, timelimit: str, backend: s
|
|
|
128
127
|
"""Perform a text search using DuckDuckGo API."""
|
|
129
128
|
webs = WEBS(proxy=proxy)
|
|
130
129
|
try:
|
|
131
|
-
webs.text(keywords, region, safesearch, timelimit, backend, max_results)
|
|
130
|
+
results = webs.text(keywords, region, safesearch, timelimit, backend, max_results)
|
|
131
|
+
_print_data(results)
|
|
132
132
|
except Exception as e:
|
|
133
133
|
logger.error(f"Error in text search: {e}")
|
|
134
134
|
raise e
|
|
135
135
|
|
|
136
136
|
@app.command()
|
|
137
|
-
@option("--keywords", "-k", help="Search keywords")
|
|
138
|
-
@option("--region", "-r", help="Region for search results", default="wt-wt")
|
|
139
|
-
@option("--safesearch", "-s", help="SafeSearch setting", default="moderate")
|
|
140
|
-
@option("--timelimit", "-t", help="Time limit for results", default=None)
|
|
141
|
-
@option("--max-results", "-m", help="Maximum number of results", type=int, default=25)
|
|
137
|
+
@option("--keywords", "-k", help="Search keywords", required=True)
|
|
142
138
|
@option("--proxy", "-p", help="Proxy URL to use for requests")
|
|
143
|
-
def answers(keywords: str,
|
|
139
|
+
def answers(keywords: str, proxy: str = None):
|
|
144
140
|
"""Perform an answers search using DuckDuckGo API."""
|
|
145
141
|
webs = WEBS(proxy=proxy)
|
|
146
142
|
try:
|
|
147
|
-
webs.answers(keywords
|
|
143
|
+
results = webs.answers(keywords)
|
|
144
|
+
_print_data(results)
|
|
148
145
|
except Exception as e:
|
|
149
146
|
logger.error(f"Error in answers search: {e}")
|
|
150
147
|
raise e
|
|
151
148
|
|
|
152
149
|
@app.command()
|
|
153
|
-
@option("--keywords", "-k", help="Search keywords")
|
|
150
|
+
@option("--keywords", "-k", help="Search keywords", required=True)
|
|
154
151
|
@option("--region", "-r", help="Region for search results", default="wt-wt")
|
|
155
152
|
@option("--safesearch", "-s", help="SafeSearch setting", default="moderate")
|
|
156
153
|
@option("--timelimit", "-t", help="Time limit for results", default=None)
|
|
@@ -177,13 +174,14 @@ def images(
|
|
|
177
174
|
"""Perform an images search using DuckDuckGo API."""
|
|
178
175
|
webs = WEBS(proxy=proxy)
|
|
179
176
|
try:
|
|
180
|
-
webs.images(keywords, region, safesearch, timelimit, size, color, type, layout, license, max_results)
|
|
177
|
+
results = webs.images(keywords, region, safesearch, timelimit, size, color, type, layout, license, max_results)
|
|
178
|
+
_print_data(results)
|
|
181
179
|
except Exception as e:
|
|
182
180
|
logger.error(f"Error in images search: {e}")
|
|
183
181
|
raise e
|
|
184
182
|
|
|
185
183
|
@app.command()
|
|
186
|
-
@option("--keywords", "-k", help="Search keywords")
|
|
184
|
+
@option("--keywords", "-k", help="Search keywords", required=True)
|
|
187
185
|
@option("--region", "-r", help="Region for search results", default="wt-wt")
|
|
188
186
|
@option("--safesearch", "-s", help="SafeSearch setting", default="moderate")
|
|
189
187
|
@option("--timelimit", "-t", help="Time limit for results", default=None)
|
|
@@ -206,13 +204,14 @@ def videos(
|
|
|
206
204
|
"""Perform a videos search using DuckDuckGo API."""
|
|
207
205
|
webs = WEBS(proxy=proxy)
|
|
208
206
|
try:
|
|
209
|
-
webs.videos(keywords, region, safesearch, timelimit, resolution, duration, license, max_results)
|
|
207
|
+
results = webs.videos(keywords, region, safesearch, timelimit, resolution, duration, license, max_results)
|
|
208
|
+
_print_data(results)
|
|
210
209
|
except Exception as e:
|
|
211
210
|
logger.error(f"Error in videos search: {e}")
|
|
212
211
|
raise e
|
|
213
212
|
|
|
214
213
|
@app.command()
|
|
215
|
-
@option("--keywords", "-k", help="Search keywords")
|
|
214
|
+
@option("--keywords", "-k", help="Search keywords", required=True)
|
|
216
215
|
@option("--region", "-r", help="Region for search results", default="wt-wt")
|
|
217
216
|
@option("--safesearch", "-s", help="SafeSearch setting", default="moderate")
|
|
218
217
|
@option("--timelimit", "-t", help="Time limit for results", default=None)
|
|
@@ -222,13 +221,14 @@ def news(keywords: str, region: str, safesearch: str, timelimit: str, max_result
|
|
|
222
221
|
"""Perform a news search using DuckDuckGo API."""
|
|
223
222
|
webs = WEBS(proxy=proxy)
|
|
224
223
|
try:
|
|
225
|
-
webs.news(keywords, region, safesearch, timelimit, max_results)
|
|
224
|
+
results = webs.news(keywords, region, safesearch, timelimit, max_results)
|
|
225
|
+
_print_data(results)
|
|
226
226
|
except Exception as e:
|
|
227
227
|
logger.error(f"Error in news search: {e}")
|
|
228
228
|
raise e
|
|
229
229
|
|
|
230
230
|
@app.command()
|
|
231
|
-
@option("--keywords", "-k", help="Search keywords")
|
|
231
|
+
@option("--keywords", "-k", help="Search keywords", required=True)
|
|
232
232
|
@option("--place", "-p", help="Simplified search - if set, the other parameters are not used")
|
|
233
233
|
@option("--street", "-s", help="House number/street")
|
|
234
234
|
@option("--city", "-c", help="City of search")
|
|
@@ -259,7 +259,7 @@ def maps(
|
|
|
259
259
|
"""Perform a maps search using DuckDuckGo API."""
|
|
260
260
|
webs = WEBS(proxy=proxy)
|
|
261
261
|
try:
|
|
262
|
-
webs.maps(
|
|
262
|
+
results = webs.maps(
|
|
263
263
|
keywords,
|
|
264
264
|
place,
|
|
265
265
|
street,
|
|
@@ -273,12 +273,13 @@ def maps(
|
|
|
273
273
|
radius,
|
|
274
274
|
max_results,
|
|
275
275
|
)
|
|
276
|
+
_print_data(results)
|
|
276
277
|
except Exception as e:
|
|
277
278
|
logger.error(f"Error in maps search: {e}")
|
|
278
279
|
raise e
|
|
279
280
|
|
|
280
281
|
@app.command()
|
|
281
|
-
@option("--keywords", "-k", help="Text for translation")
|
|
282
|
+
@option("--keywords", "-k", help="Text for translation", required=True)
|
|
282
283
|
@option("--from", "-f", help="Language to translate from (defaults automatically)")
|
|
283
284
|
@option("--to", "-t", help="Language to translate to (default: 'en')", default="en")
|
|
284
285
|
@option("--proxy", "-p", help="Proxy URL to use for requests")
|
|
@@ -286,35 +287,26 @@ def translate(keywords: str, from_: str, to: str, proxy: str = None):
|
|
|
286
287
|
"""Perform translation using DuckDuckGo API."""
|
|
287
288
|
webs = WEBS(proxy=proxy)
|
|
288
289
|
try:
|
|
289
|
-
webs.translate(keywords, from_, to)
|
|
290
|
+
results = webs.translate(keywords, from_, to)
|
|
291
|
+
_print_data(results)
|
|
290
292
|
except Exception as e:
|
|
291
293
|
logger.error(f"Error in translation: {e}")
|
|
292
294
|
raise e
|
|
293
295
|
|
|
294
296
|
@app.command()
|
|
295
|
-
@option("--keywords", "-k", help="Search keywords")
|
|
297
|
+
@option("--keywords", "-k", help="Search keywords", required=True)
|
|
296
298
|
@option("--region", "-r", help="Region for search results", default="wt-wt")
|
|
297
299
|
@option("--proxy", "-p", help="Proxy URL to use for requests")
|
|
298
300
|
def suggestions(keywords: str, region: str, proxy: str = None):
|
|
299
301
|
"""Perform a suggestions search using DuckDuckGo API."""
|
|
300
302
|
webs = WEBS(proxy=proxy)
|
|
301
303
|
try:
|
|
302
|
-
webs.suggestions(keywords, region)
|
|
304
|
+
results = webs.suggestions(keywords, region)
|
|
305
|
+
_print_data(results)
|
|
303
306
|
except Exception as e:
|
|
304
307
|
logger.error(f"Error in suggestions search: {e}")
|
|
305
308
|
raise e
|
|
306
309
|
|
|
307
|
-
@app.command()
|
|
308
|
-
@option("--proxy", help="Proxy URL to use for requests")
|
|
309
|
-
def interactive(proxy: str = None):
|
|
310
|
-
"""Start an interactive search session with AI-powered responses."""
|
|
311
|
-
webs = WEBS(proxy=proxy)
|
|
312
|
-
try:
|
|
313
|
-
webs.interactive()
|
|
314
|
-
except Exception as e:
|
|
315
|
-
logger.error(f"Error in interactive mode: {e}")
|
|
316
|
-
raise e
|
|
317
|
-
|
|
318
310
|
def main():
|
|
319
311
|
"""Main entry point for the CLI."""
|
|
320
312
|
try:
|
|
@@ -324,4 +316,4 @@ def main():
|
|
|
324
316
|
sys.exit(1)
|
|
325
317
|
|
|
326
318
|
if __name__ == "__main__":
|
|
327
|
-
main()
|
|
319
|
+
main()
|
webscout/litprinter/__init__.py
CHANGED
|
@@ -69,25 +69,36 @@ from collections import defaultdict
|
|
|
69
69
|
import shutil
|
|
70
70
|
import inspect
|
|
71
71
|
from .colors import Colors
|
|
72
|
+
import ctypes
|
|
72
73
|
|
|
74
|
+
# Checking Pygments availability
|
|
73
75
|
try:
|
|
74
76
|
from pygments import highlight
|
|
75
77
|
from pygments.lexers import get_lexer_by_name
|
|
76
78
|
from pygments.formatters import Terminal256Formatter
|
|
79
|
+
|
|
77
80
|
PYGMENTS_AVAILABLE = True
|
|
78
81
|
except ImportError:
|
|
79
82
|
PYGMENTS_AVAILABLE = False
|
|
80
83
|
|
|
81
|
-
#
|
|
84
|
+
# Enabling UTF-8 output on Windows
|
|
82
85
|
if sys.platform == 'win32':
|
|
83
86
|
import ctypes
|
|
87
|
+
|
|
84
88
|
kernel32 = ctypes.windll.kernel32
|
|
85
89
|
kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)
|
|
86
|
-
sys.stdout.reconfigure(encoding='utf-8')
|
|
87
90
|
|
|
88
|
-
#
|
|
91
|
+
# Checking and overriding sys.stdout
|
|
92
|
+
try:
|
|
93
|
+
if sys.stdout is not None:
|
|
94
|
+
sys.stdout.reconfigure(encoding='utf-8')
|
|
95
|
+
else:
|
|
96
|
+
print("sys.stdout is not available.")
|
|
97
|
+
except AttributeError:
|
|
98
|
+
print("Failed to redefine sys.stdout.")
|
|
99
|
+
|
|
100
|
+
# Enabling ANSI escape sequences for Windows
|
|
89
101
|
if os.name == 'nt':
|
|
90
|
-
import ctypes
|
|
91
102
|
kernel32 = ctypes.windll.kernel32
|
|
92
103
|
kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)
|
|
93
104
|
|
|
@@ -714,6 +725,4 @@ class LitPrinter:
|
|
|
714
725
|
|
|
715
726
|
def _clear_line(self):
|
|
716
727
|
"""Clear the current line."""
|
|
717
|
-
print('\r' + ' ' * self._get_terminal_width(), end='\r', file=self.file, flush=True)
|
|
718
|
-
|
|
719
|
-
|
|
728
|
+
print('\r' + ' ' * self._get_terminal_width(), end='\r', file=self.file, flush=True)
|
webscout/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "6.
|
|
1
|
+
__version__ = "6.8"
|
|
2
2
|
__prog__ = "webscout"
|
webscout/webscout_search.py
CHANGED
|
@@ -180,7 +180,7 @@ class WEBS:
|
|
|
180
180
|
)
|
|
181
181
|
self._chat_vqd = resp.headers.get("x-vqd-4", "")
|
|
182
182
|
|
|
183
|
-
data = ",".join(
|
|
183
|
+
data = ",".join(line.strip() for line in resp.text.rstrip("[DONE]LIMT_CVRSA\n").split("data:") if line.strip())
|
|
184
184
|
data = json_loads("[" + data + "]")
|
|
185
185
|
|
|
186
186
|
results = []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: webscout
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.8
|
|
4
4
|
Summary: Search for anything using Google, DuckDuckGo, phind.com, Contains AI models, can transcribe yt videos, temporary email and phone number generation, has TTS support, webai (terminal gpt and open interpreter) and offline LLMs and more
|
|
5
5
|
Author: OEvortex
|
|
6
6
|
Author-email: helpingai5@gmail.com
|
|
@@ -232,7 +232,7 @@ python -m webscout --help
|
|
|
232
232
|
```python
|
|
233
233
|
from webscout import weather as w
|
|
234
234
|
weather = w.get("Qazigund")
|
|
235
|
-
|
|
235
|
+
print(weather)
|
|
236
236
|
```
|
|
237
237
|
|
|
238
238
|
### 2. Weather ASCII
|
|
@@ -1321,12 +1321,6 @@ autollama.main(model_path, gguf_file)
|
|
|
1321
1321
|
* The `model_path` in `autollama` is the Hugging Face model ID, and `gguf_file` is the GGUF file ID.
|
|
1322
1322
|
|
|
1323
1323
|
|
|
1324
|
-
## 🌐 `Webai` - Terminal GPT and an Open Interpreter
|
|
1325
|
-
|
|
1326
|
-
```bash
|
|
1327
|
-
python -m webscout.webai webai --provider "phind" --rawdog
|
|
1328
|
-
```
|
|
1329
|
-
|
|
1330
1324
|
<div align="center">
|
|
1331
1325
|
<!-- Replace `#` with your actual links -->
|
|
1332
1326
|
<a href="https://t.me/official_helpingai"><img alt="Telegram" src="https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white"></a>
|