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/Provider/TTS/parler.py
CHANGED
|
@@ -1,108 +1,135 @@
|
|
|
1
|
-
import time
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
from typing import Generator
|
|
4
|
-
from playsound import playsound
|
|
5
|
-
from webscout import exceptions
|
|
6
|
-
from webscout.AIbase import TTSProvider
|
|
7
|
-
|
|
8
|
-
from gradio_client import Client
|
|
9
|
-
import os
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class ParlerTTS(TTSProvider):
|
|
13
|
-
"""
|
|
14
|
-
A class to interact with the Parler TTS API through Gradio Client.
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
def __init__(self, timeout: int = 20, proxies: dict = None):
|
|
18
|
-
"""Initializes the Parler TTS client."""
|
|
19
|
-
self.api_endpoint = "/gen_tts"
|
|
20
|
-
self.client = Client("parler-tts/parler_tts") # Initialize the Gradio client
|
|
21
|
-
self.timeout = timeout
|
|
22
|
-
self.audio_cache_dir = Path("./audio_cache")
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
str: The
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
import time
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Generator
|
|
4
|
+
from playsound import playsound
|
|
5
|
+
from webscout import exceptions
|
|
6
|
+
from webscout.AIbase import TTSProvider
|
|
7
|
+
from webscout.Litlogger import LitLogger, LogFormat, ColorScheme
|
|
8
|
+
from gradio_client import Client
|
|
9
|
+
import os
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ParlerTTS(TTSProvider):
|
|
13
|
+
"""
|
|
14
|
+
A class to interact with the Parler TTS API through Gradio Client.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(self, timeout: int = 20, proxies: dict = None):
|
|
18
|
+
"""Initializes the Parler TTS client."""
|
|
19
|
+
self.api_endpoint = "/gen_tts"
|
|
20
|
+
self.client = Client("parler-tts/parler_tts") # Initialize the Gradio client
|
|
21
|
+
self.timeout = timeout
|
|
22
|
+
self.audio_cache_dir = Path("./audio_cache")
|
|
23
|
+
self.logger = LitLogger(
|
|
24
|
+
name="ParlerTTS",
|
|
25
|
+
format=LogFormat.MODERN_EMOJI,
|
|
26
|
+
color_scheme=ColorScheme.AURORA
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
def tts(self, text: str, description: str = "", use_large: bool = False, verbose: bool = True) -> str:
|
|
30
|
+
"""
|
|
31
|
+
Converts text to speech using the Parler TTS API.
|
|
32
|
+
|
|
33
|
+
Args:
|
|
34
|
+
text (str): The text to be converted to speech.
|
|
35
|
+
description (str, optional): Description of the desired voice characteristics. Defaults to "".
|
|
36
|
+
use_large (bool, optional): Whether to use the large model variant. Defaults to False.
|
|
37
|
+
verbose (bool, optional): Whether to log detailed information. Defaults to True.
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
str: The filename of the saved audio file.
|
|
41
|
+
|
|
42
|
+
Raises:
|
|
43
|
+
exceptions.FailedToGenerateResponseError: If there is an error generating or saving the audio.
|
|
44
|
+
"""
|
|
45
|
+
filename = self.audio_cache_dir / f"{int(time.time())}.wav"
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
if verbose:
|
|
49
|
+
self.logger.info(f"Generating TTS with description: {description} 🎙️")
|
|
50
|
+
|
|
51
|
+
result = self.client.predict(
|
|
52
|
+
text=text,
|
|
53
|
+
description=description,
|
|
54
|
+
use_large=use_large,
|
|
55
|
+
api_name=self.api_endpoint,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
if isinstance(result, bytes):
|
|
59
|
+
audio_bytes = result
|
|
60
|
+
elif isinstance(result, str) and os.path.isfile(result):
|
|
61
|
+
with open(result, "rb") as f:
|
|
62
|
+
audio_bytes = f.read()
|
|
63
|
+
else:
|
|
64
|
+
raise ValueError(f"Unexpected response from API: {result}")
|
|
65
|
+
|
|
66
|
+
self._save_audio(audio_bytes, filename)
|
|
67
|
+
|
|
68
|
+
if verbose:
|
|
69
|
+
self.logger.success(f"Audio generated successfully: {filename} 🔊")
|
|
70
|
+
|
|
71
|
+
return filename.as_posix()
|
|
72
|
+
|
|
73
|
+
except Exception as e:
|
|
74
|
+
self.logger.critical(f"Error generating audio: {e} 🚨")
|
|
75
|
+
raise exceptions.FailedToGenerateResponseError(
|
|
76
|
+
f"Error generating audio after multiple retries: {e}"
|
|
77
|
+
) from e
|
|
78
|
+
|
|
79
|
+
def _save_audio(self, audio_data: bytes, filename: Path):
|
|
80
|
+
"""
|
|
81
|
+
Saves the audio data to a WAV file in the audio cache directory.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
audio_data (bytes): Audio data to save
|
|
85
|
+
filename (Path): Path to save the audio file
|
|
86
|
+
|
|
87
|
+
Raises:
|
|
88
|
+
exceptions.FailedToGenerateResponseError: If there is an error saving the audio.
|
|
89
|
+
"""
|
|
90
|
+
try:
|
|
91
|
+
self.audio_cache_dir.mkdir(parents=True, exist_ok=True)
|
|
92
|
+
with open(filename, "wb") as f:
|
|
93
|
+
f.write(audio_data)
|
|
94
|
+
self.logger.debug(f"Audio saved to {filename} 💾")
|
|
95
|
+
|
|
96
|
+
except Exception as e:
|
|
97
|
+
self.logger.error(f"Error saving audio: {e} 🔇")
|
|
98
|
+
raise exceptions.FailedToGenerateResponseError(f"Error saving audio: {e}")
|
|
99
|
+
|
|
100
|
+
def play_audio(self, filename: str):
|
|
101
|
+
"""
|
|
102
|
+
Plays an audio file using playsound.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
filename (str): The path to the audio file.
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
RuntimeError: If there is an error playing the audio.
|
|
109
|
+
"""
|
|
110
|
+
try:
|
|
111
|
+
self.logger.info(f"Playing audio: {filename} 🎵")
|
|
112
|
+
playsound(filename)
|
|
113
|
+
except Exception as e:
|
|
114
|
+
self.logger.error(f"Error playing audio: {e} 🔇")
|
|
115
|
+
raise RuntimeError(f"Error playing audio: {e}")
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
# Example usage
|
|
119
|
+
if __name__ == "__main__":
|
|
120
|
+
parlertts = ParlerTTS()
|
|
121
|
+
text = (
|
|
122
|
+
"All of the data, pre-processing, training code, and weights are released "
|
|
123
|
+
"publicly under a permissive license, enabling the community to build on our work "
|
|
124
|
+
"and develop their own powerful models."
|
|
125
|
+
)
|
|
126
|
+
voice_description = (
|
|
127
|
+
"Laura's voice is monotone yet slightly fast in delivery, with a very close "
|
|
128
|
+
"recording that almost has no background noise."
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
parlertts.logger.info("Generating audio...")
|
|
132
|
+
audio_file = parlertts.tts(text, description=voice_description, use_large=False)
|
|
133
|
+
|
|
134
|
+
parlertts.logger.info("Playing audio...")
|
|
108
135
|
parlertts.play_audio(audio_file)
|