webscout 8.2.8__py3-none-any.whl → 8.3__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/AIauto.py +34 -16
- webscout/AIbase.py +96 -37
- webscout/AIutel.py +491 -87
- webscout/Bard.py +441 -323
- webscout/Extra/GitToolkit/__init__.py +10 -10
- webscout/Extra/YTToolkit/ytapi/video.py +232 -232
- webscout/Litlogger/README.md +10 -0
- webscout/Litlogger/__init__.py +7 -59
- webscout/Litlogger/formats.py +4 -0
- webscout/Litlogger/handlers.py +103 -0
- webscout/Litlogger/levels.py +13 -0
- webscout/Litlogger/logger.py +92 -0
- webscout/Provider/AISEARCH/Perplexity.py +332 -358
- webscout/Provider/AISEARCH/felo_search.py +9 -35
- webscout/Provider/AISEARCH/genspark_search.py +30 -56
- webscout/Provider/AISEARCH/hika_search.py +4 -16
- webscout/Provider/AISEARCH/iask_search.py +410 -436
- webscout/Provider/AISEARCH/monica_search.py +4 -30
- webscout/Provider/AISEARCH/scira_search.py +6 -32
- webscout/Provider/AISEARCH/webpilotai_search.py +38 -64
- webscout/Provider/Blackboxai.py +155 -35
- webscout/Provider/ChatSandbox.py +2 -1
- webscout/Provider/Deepinfra.py +339 -339
- webscout/Provider/ExaChat.py +358 -358
- webscout/Provider/Gemini.py +169 -169
- webscout/Provider/GithubChat.py +1 -2
- webscout/Provider/Glider.py +3 -3
- webscout/Provider/HeckAI.py +172 -82
- webscout/Provider/LambdaChat.py +1 -0
- webscout/Provider/MCPCore.py +7 -3
- webscout/Provider/OPENAI/BLACKBOXAI.py +421 -139
- webscout/Provider/OPENAI/Cloudflare.py +38 -21
- webscout/Provider/OPENAI/FalconH1.py +457 -0
- webscout/Provider/OPENAI/FreeGemini.py +35 -18
- webscout/Provider/OPENAI/NEMOTRON.py +34 -34
- webscout/Provider/OPENAI/PI.py +427 -0
- webscout/Provider/OPENAI/Qwen3.py +304 -0
- webscout/Provider/OPENAI/README.md +952 -1253
- webscout/Provider/OPENAI/TwoAI.py +374 -0
- webscout/Provider/OPENAI/__init__.py +7 -1
- webscout/Provider/OPENAI/ai4chat.py +73 -63
- webscout/Provider/OPENAI/api.py +869 -644
- webscout/Provider/OPENAI/base.py +2 -0
- webscout/Provider/OPENAI/c4ai.py +34 -13
- webscout/Provider/OPENAI/chatgpt.py +575 -556
- webscout/Provider/OPENAI/chatgptclone.py +512 -487
- webscout/Provider/OPENAI/chatsandbox.py +11 -6
- webscout/Provider/OPENAI/copilot.py +258 -0
- webscout/Provider/OPENAI/deepinfra.py +327 -318
- webscout/Provider/OPENAI/e2b.py +140 -104
- webscout/Provider/OPENAI/exaai.py +420 -411
- webscout/Provider/OPENAI/exachat.py +448 -443
- webscout/Provider/OPENAI/flowith.py +7 -3
- webscout/Provider/OPENAI/freeaichat.py +12 -8
- webscout/Provider/OPENAI/glider.py +15 -8
- webscout/Provider/OPENAI/groq.py +5 -2
- webscout/Provider/OPENAI/heckai.py +311 -307
- webscout/Provider/OPENAI/llmchatco.py +9 -7
- webscout/Provider/OPENAI/mcpcore.py +18 -9
- webscout/Provider/OPENAI/multichat.py +7 -5
- webscout/Provider/OPENAI/netwrck.py +16 -11
- webscout/Provider/OPENAI/oivscode.py +290 -0
- webscout/Provider/OPENAI/opkfc.py +507 -496
- webscout/Provider/OPENAI/pydantic_imports.py +172 -0
- webscout/Provider/OPENAI/scirachat.py +29 -17
- webscout/Provider/OPENAI/sonus.py +308 -303
- webscout/Provider/OPENAI/standardinput.py +442 -433
- webscout/Provider/OPENAI/textpollinations.py +18 -11
- webscout/Provider/OPENAI/toolbaz.py +419 -413
- webscout/Provider/OPENAI/typefully.py +17 -10
- webscout/Provider/OPENAI/typegpt.py +21 -11
- webscout/Provider/OPENAI/uncovrAI.py +477 -462
- webscout/Provider/OPENAI/utils.py +90 -79
- webscout/Provider/OPENAI/venice.py +435 -425
- webscout/Provider/OPENAI/wisecat.py +387 -381
- webscout/Provider/OPENAI/writecream.py +166 -163
- webscout/Provider/OPENAI/x0gpt.py +26 -37
- webscout/Provider/OPENAI/yep.py +384 -356
- webscout/Provider/PI.py +2 -1
- webscout/Provider/TTI/README.md +55 -101
- webscout/Provider/TTI/__init__.py +4 -9
- webscout/Provider/TTI/aiarta.py +365 -0
- webscout/Provider/TTI/artbit.py +0 -0
- webscout/Provider/TTI/base.py +64 -0
- webscout/Provider/TTI/fastflux.py +200 -0
- webscout/Provider/TTI/magicstudio.py +201 -0
- webscout/Provider/TTI/piclumen.py +203 -0
- webscout/Provider/TTI/pixelmuse.py +225 -0
- webscout/Provider/TTI/pollinations.py +221 -0
- webscout/Provider/TTI/utils.py +11 -0
- webscout/Provider/TTS/__init__.py +2 -1
- webscout/Provider/TTS/base.py +159 -159
- webscout/Provider/TTS/openai_fm.py +129 -0
- webscout/Provider/TextPollinationsAI.py +308 -308
- webscout/Provider/TwoAI.py +239 -44
- webscout/Provider/UNFINISHED/Youchat.py +330 -330
- webscout/Provider/UNFINISHED/puterjs.py +635 -0
- webscout/Provider/UNFINISHED/test_lmarena.py +119 -119
- webscout/Provider/Writecream.py +246 -246
- webscout/Provider/__init__.py +2 -2
- webscout/Provider/ai4chat.py +33 -8
- webscout/Provider/granite.py +41 -6
- webscout/Provider/koala.py +169 -169
- webscout/Provider/oivscode.py +309 -0
- webscout/Provider/samurai.py +3 -2
- webscout/Provider/scnet.py +1 -0
- webscout/Provider/typegpt.py +3 -3
- webscout/Provider/uncovr.py +368 -368
- webscout/client.py +70 -0
- webscout/litprinter/__init__.py +58 -58
- webscout/optimizers.py +419 -419
- webscout/scout/README.md +3 -1
- webscout/scout/core/crawler.py +134 -64
- webscout/scout/core/scout.py +148 -109
- webscout/scout/element.py +106 -88
- webscout/swiftcli/Readme.md +323 -323
- webscout/swiftcli/plugins/manager.py +9 -2
- webscout/version.py +1 -1
- webscout/zeroart/__init__.py +134 -134
- webscout/zeroart/effects.py +100 -100
- webscout/zeroart/fonts.py +1238 -1238
- {webscout-8.2.8.dist-info → webscout-8.3.dist-info}/METADATA +160 -35
- webscout-8.3.dist-info/RECORD +290 -0
- {webscout-8.2.8.dist-info → webscout-8.3.dist-info}/WHEEL +1 -1
- {webscout-8.2.8.dist-info → webscout-8.3.dist-info}/entry_points.txt +1 -0
- webscout/Litlogger/Readme.md +0 -175
- webscout/Litlogger/core/__init__.py +0 -6
- webscout/Litlogger/core/level.py +0 -23
- webscout/Litlogger/core/logger.py +0 -165
- webscout/Litlogger/handlers/__init__.py +0 -12
- webscout/Litlogger/handlers/console.py +0 -33
- webscout/Litlogger/handlers/file.py +0 -143
- webscout/Litlogger/handlers/network.py +0 -173
- webscout/Litlogger/styles/__init__.py +0 -7
- webscout/Litlogger/styles/colors.py +0 -249
- webscout/Litlogger/styles/formats.py +0 -458
- webscout/Litlogger/styles/text.py +0 -87
- webscout/Litlogger/utils/__init__.py +0 -6
- webscout/Litlogger/utils/detectors.py +0 -153
- webscout/Litlogger/utils/formatters.py +0 -200
- webscout/Provider/ChatGPTGratis.py +0 -194
- webscout/Provider/TTI/AiForce/README.md +0 -159
- webscout/Provider/TTI/AiForce/__init__.py +0 -22
- webscout/Provider/TTI/AiForce/async_aiforce.py +0 -224
- webscout/Provider/TTI/AiForce/sync_aiforce.py +0 -245
- webscout/Provider/TTI/FreeAIPlayground/README.md +0 -99
- webscout/Provider/TTI/FreeAIPlayground/__init__.py +0 -9
- webscout/Provider/TTI/FreeAIPlayground/async_freeaiplayground.py +0 -181
- webscout/Provider/TTI/FreeAIPlayground/sync_freeaiplayground.py +0 -180
- webscout/Provider/TTI/ImgSys/README.md +0 -174
- webscout/Provider/TTI/ImgSys/__init__.py +0 -23
- webscout/Provider/TTI/ImgSys/async_imgsys.py +0 -202
- webscout/Provider/TTI/ImgSys/sync_imgsys.py +0 -195
- webscout/Provider/TTI/MagicStudio/README.md +0 -101
- webscout/Provider/TTI/MagicStudio/__init__.py +0 -2
- webscout/Provider/TTI/MagicStudio/async_magicstudio.py +0 -111
- webscout/Provider/TTI/MagicStudio/sync_magicstudio.py +0 -109
- webscout/Provider/TTI/Nexra/README.md +0 -155
- webscout/Provider/TTI/Nexra/__init__.py +0 -22
- webscout/Provider/TTI/Nexra/async_nexra.py +0 -286
- webscout/Provider/TTI/Nexra/sync_nexra.py +0 -258
- webscout/Provider/TTI/PollinationsAI/README.md +0 -146
- webscout/Provider/TTI/PollinationsAI/__init__.py +0 -23
- webscout/Provider/TTI/PollinationsAI/async_pollinations.py +0 -311
- webscout/Provider/TTI/PollinationsAI/sync_pollinations.py +0 -265
- webscout/Provider/TTI/aiarta/README.md +0 -134
- webscout/Provider/TTI/aiarta/__init__.py +0 -2
- webscout/Provider/TTI/aiarta/async_aiarta.py +0 -482
- webscout/Provider/TTI/aiarta/sync_aiarta.py +0 -440
- webscout/Provider/TTI/artbit/README.md +0 -100
- webscout/Provider/TTI/artbit/__init__.py +0 -22
- webscout/Provider/TTI/artbit/async_artbit.py +0 -155
- webscout/Provider/TTI/artbit/sync_artbit.py +0 -148
- webscout/Provider/TTI/fastflux/README.md +0 -129
- webscout/Provider/TTI/fastflux/__init__.py +0 -22
- webscout/Provider/TTI/fastflux/async_fastflux.py +0 -261
- webscout/Provider/TTI/fastflux/sync_fastflux.py +0 -252
- webscout/Provider/TTI/huggingface/README.md +0 -114
- webscout/Provider/TTI/huggingface/__init__.py +0 -22
- webscout/Provider/TTI/huggingface/async_huggingface.py +0 -199
- webscout/Provider/TTI/huggingface/sync_huggingface.py +0 -195
- webscout/Provider/TTI/piclumen/README.md +0 -161
- webscout/Provider/TTI/piclumen/__init__.py +0 -23
- webscout/Provider/TTI/piclumen/async_piclumen.py +0 -268
- webscout/Provider/TTI/piclumen/sync_piclumen.py +0 -233
- webscout/Provider/TTI/pixelmuse/README.md +0 -79
- webscout/Provider/TTI/pixelmuse/__init__.py +0 -4
- webscout/Provider/TTI/pixelmuse/async_pixelmuse.py +0 -249
- webscout/Provider/TTI/pixelmuse/sync_pixelmuse.py +0 -182
- webscout/Provider/TTI/talkai/README.md +0 -139
- webscout/Provider/TTI/talkai/__init__.py +0 -4
- webscout/Provider/TTI/talkai/async_talkai.py +0 -229
- webscout/Provider/TTI/talkai/sync_talkai.py +0 -207
- webscout/Provider/UNFINISHED/oivscode.py +0 -351
- webscout-8.2.8.dist-info/RECORD +0 -334
- {webscout-8.2.8.dist-info → webscout-8.3.dist-info}/licenses/LICENSE.md +0 -0
- {webscout-8.2.8.dist-info → webscout-8.3.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import socket
|
|
3
|
+
import http.client
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Optional
|
|
7
|
+
|
|
8
|
+
from .levels import LogLevel
|
|
9
|
+
|
|
10
|
+
RESET = "\033[0m"
|
|
11
|
+
LEVEL_COLORS = {
|
|
12
|
+
LogLevel.TRACE: "\033[90m",
|
|
13
|
+
LogLevel.DEBUG: "\033[36m",
|
|
14
|
+
LogLevel.INFO: "\033[32m",
|
|
15
|
+
LogLevel.WARNING: "\033[33m",
|
|
16
|
+
LogLevel.ERROR: "\033[31m",
|
|
17
|
+
LogLevel.CRITICAL: "\033[41m\033[97m",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
class Handler:
|
|
21
|
+
def __init__(self, level: LogLevel = LogLevel.DEBUG):
|
|
22
|
+
self.level = level
|
|
23
|
+
|
|
24
|
+
def emit(self, message: str, level: LogLevel):
|
|
25
|
+
raise NotImplementedError
|
|
26
|
+
|
|
27
|
+
class ConsoleHandler(Handler):
|
|
28
|
+
def __init__(self, stream=None, level: LogLevel = LogLevel.DEBUG):
|
|
29
|
+
super().__init__(level)
|
|
30
|
+
self.stream = stream or os.sys.stdout
|
|
31
|
+
|
|
32
|
+
def emit(self, message: str, level: LogLevel):
|
|
33
|
+
color = LEVEL_COLORS.get(level, "")
|
|
34
|
+
self.stream.write(f"{color}{message}{RESET}\n")
|
|
35
|
+
self.stream.flush()
|
|
36
|
+
|
|
37
|
+
class FileHandler(Handler):
|
|
38
|
+
def __init__(self, path: str, level: LogLevel = LogLevel.DEBUG, max_bytes: int = 0, backups: int = 0):
|
|
39
|
+
super().__init__(level)
|
|
40
|
+
self.path = Path(path)
|
|
41
|
+
self.max_bytes = max_bytes
|
|
42
|
+
self.backups = backups
|
|
43
|
+
self._open()
|
|
44
|
+
|
|
45
|
+
def _open(self):
|
|
46
|
+
self.path.parent.mkdir(parents=True, exist_ok=True)
|
|
47
|
+
self._file = open(self.path, "a", encoding="utf-8")
|
|
48
|
+
|
|
49
|
+
def _rotate(self):
|
|
50
|
+
if self.backups <= 0:
|
|
51
|
+
self._file.close()
|
|
52
|
+
self.path.unlink(missing_ok=True)
|
|
53
|
+
self._open()
|
|
54
|
+
return
|
|
55
|
+
self._file.close()
|
|
56
|
+
for i in range(self.backups, 0, -1):
|
|
57
|
+
src = self.path.with_suffix(f".{i}") if i == 1 else self.path.with_suffix(f".{i-1}")
|
|
58
|
+
dst = self.path.with_suffix(f".{i}")
|
|
59
|
+
if src.exists():
|
|
60
|
+
if dst.exists():
|
|
61
|
+
dst.unlink()
|
|
62
|
+
src.rename(dst)
|
|
63
|
+
self._open()
|
|
64
|
+
|
|
65
|
+
def emit(self, message: str, level: LogLevel):
|
|
66
|
+
if self.level and level < self.level:
|
|
67
|
+
return
|
|
68
|
+
self._file.write(message + "\n")
|
|
69
|
+
self._file.flush()
|
|
70
|
+
if self.max_bytes and self._file.tell() >= self.max_bytes:
|
|
71
|
+
self._rotate()
|
|
72
|
+
|
|
73
|
+
class NetworkHandler(Handler):
|
|
74
|
+
def __init__(self, host: str, port: int, use_https: bool = False, level: LogLevel = LogLevel.DEBUG):
|
|
75
|
+
super().__init__(level)
|
|
76
|
+
self.host = host
|
|
77
|
+
self.port = port
|
|
78
|
+
self.use_https = use_https
|
|
79
|
+
|
|
80
|
+
def emit(self, message: str, level: LogLevel):
|
|
81
|
+
if level < self.level:
|
|
82
|
+
return
|
|
83
|
+
if self.use_https:
|
|
84
|
+
conn = http.client.HTTPSConnection(self.host, self.port, timeout=5)
|
|
85
|
+
else:
|
|
86
|
+
conn = http.client.HTTPConnection(self.host, self.port, timeout=5)
|
|
87
|
+
try:
|
|
88
|
+
conn.request("POST", "/", body=message.encode(), headers={"Content-Type": "text/plain"})
|
|
89
|
+
conn.getresponse().read()
|
|
90
|
+
finally:
|
|
91
|
+
conn.close()
|
|
92
|
+
|
|
93
|
+
class TCPHandler(Handler):
|
|
94
|
+
def __init__(self, host: str, port: int, level: LogLevel = LogLevel.DEBUG):
|
|
95
|
+
super().__init__(level)
|
|
96
|
+
self.host = host
|
|
97
|
+
self.port = port
|
|
98
|
+
|
|
99
|
+
def emit(self, message: str, level: LogLevel):
|
|
100
|
+
if level < self.level:
|
|
101
|
+
return
|
|
102
|
+
with socket.create_connection((self.host, self.port), timeout=5) as sock:
|
|
103
|
+
sock.sendall(message.encode() + b"\n")
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import sys
|
|
3
|
+
import traceback
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from typing import List, Optional
|
|
6
|
+
|
|
7
|
+
from .levels import LogLevel
|
|
8
|
+
from .formats import LogFormat
|
|
9
|
+
from .handlers import Handler, ConsoleHandler
|
|
10
|
+
|
|
11
|
+
class Logger:
|
|
12
|
+
def __init__(
|
|
13
|
+
self,
|
|
14
|
+
name: str = "LitLogger",
|
|
15
|
+
level: LogLevel = LogLevel.INFO,
|
|
16
|
+
handlers: Optional[List[Handler]] = None,
|
|
17
|
+
fmt: str = LogFormat.DEFAULT, # <--- use LogFormat.DEFAULT
|
|
18
|
+
async_mode: bool = False,
|
|
19
|
+
):
|
|
20
|
+
self.name = name
|
|
21
|
+
self.level = level
|
|
22
|
+
self.format = fmt
|
|
23
|
+
self.async_mode = async_mode
|
|
24
|
+
self.handlers = handlers or [ConsoleHandler()]
|
|
25
|
+
|
|
26
|
+
def _format(self, level: LogLevel, message: str) -> str:
|
|
27
|
+
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
28
|
+
return self.format.format(time=now, level=level.name, name=self.name, message=message)
|
|
29
|
+
|
|
30
|
+
def _should_log(self, level: LogLevel) -> bool:
|
|
31
|
+
return level >= self.level
|
|
32
|
+
|
|
33
|
+
async def _log_async(self, level: LogLevel, message: str):
|
|
34
|
+
if not self._should_log(level):
|
|
35
|
+
return
|
|
36
|
+
record = self._format(level, message)
|
|
37
|
+
tasks = []
|
|
38
|
+
for h in self.handlers:
|
|
39
|
+
if level >= h.level:
|
|
40
|
+
if asyncio.iscoroutinefunction(h.emit):
|
|
41
|
+
tasks.append(h.emit(record, level))
|
|
42
|
+
else:
|
|
43
|
+
tasks.append(asyncio.to_thread(h.emit, record, level))
|
|
44
|
+
if tasks:
|
|
45
|
+
await asyncio.gather(*tasks)
|
|
46
|
+
|
|
47
|
+
def _log(self, level: LogLevel, message: str):
|
|
48
|
+
if not self._should_log(level):
|
|
49
|
+
return
|
|
50
|
+
record = self._format(level, message)
|
|
51
|
+
for h in self.handlers:
|
|
52
|
+
if level >= h.level:
|
|
53
|
+
h.emit(record, level)
|
|
54
|
+
|
|
55
|
+
def log(self, level: LogLevel, message: str):
|
|
56
|
+
if self.async_mode:
|
|
57
|
+
loop = asyncio.get_event_loop()
|
|
58
|
+
if loop.is_running():
|
|
59
|
+
return asyncio.create_task(self._log_async(level, message))
|
|
60
|
+
return loop.run_until_complete(self._log_async(level, message))
|
|
61
|
+
self._log(level, message)
|
|
62
|
+
|
|
63
|
+
def trace(self, message: str):
|
|
64
|
+
self.log(LogLevel.TRACE, message)
|
|
65
|
+
|
|
66
|
+
def debug(self, message: str):
|
|
67
|
+
self.log(LogLevel.DEBUG, message)
|
|
68
|
+
|
|
69
|
+
def info(self, message: str):
|
|
70
|
+
self.log(LogLevel.INFO, message)
|
|
71
|
+
|
|
72
|
+
def warning(self, message: str):
|
|
73
|
+
self.log(LogLevel.WARNING, message)
|
|
74
|
+
|
|
75
|
+
def error(self, message: str):
|
|
76
|
+
self.log(LogLevel.ERROR, message)
|
|
77
|
+
|
|
78
|
+
def critical(self, message: str):
|
|
79
|
+
self.log(LogLevel.CRITICAL, message)
|
|
80
|
+
|
|
81
|
+
def exception(self, message: str):
|
|
82
|
+
exc = sys.exc_info()
|
|
83
|
+
formatted = f"{message}\n" + "".join(traceback.format_exception(*exc))
|
|
84
|
+
self.error(formatted)
|
|
85
|
+
|
|
86
|
+
def __enter__(self):
|
|
87
|
+
return self
|
|
88
|
+
|
|
89
|
+
def __exit__(self, exc_type, exc, tb):
|
|
90
|
+
if exc_type:
|
|
91
|
+
self.exception(str(exc))
|
|
92
|
+
return False
|