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.

Files changed (116) hide show
  1. webscout/AIutel.py +7 -54
  2. webscout/DWEBS.py +48 -26
  3. webscout/{YTdownloader.py → Extra/YTToolkit/YTdownloader.py} +990 -1103
  4. webscout/Extra/YTToolkit/__init__.py +3 -0
  5. webscout/{transcriber.py → Extra/YTToolkit/transcriber.py} +1 -1
  6. webscout/Extra/YTToolkit/ytapi/__init__.py +6 -0
  7. webscout/Extra/YTToolkit/ytapi/channel.py +307 -0
  8. webscout/Extra/YTToolkit/ytapi/errors.py +13 -0
  9. webscout/Extra/YTToolkit/ytapi/extras.py +45 -0
  10. webscout/Extra/YTToolkit/ytapi/https.py +88 -0
  11. webscout/Extra/YTToolkit/ytapi/patterns.py +61 -0
  12. webscout/Extra/YTToolkit/ytapi/playlist.py +59 -0
  13. webscout/Extra/YTToolkit/ytapi/pool.py +8 -0
  14. webscout/Extra/YTToolkit/ytapi/query.py +37 -0
  15. webscout/Extra/YTToolkit/ytapi/stream.py +60 -0
  16. webscout/Extra/YTToolkit/ytapi/utils.py +62 -0
  17. webscout/Extra/YTToolkit/ytapi/video.py +102 -0
  18. webscout/Extra/__init__.py +2 -1
  19. webscout/Extra/autocoder/autocoder_utiles.py +119 -101
  20. webscout/Extra/autocoder/rawdog.py +679 -680
  21. webscout/Extra/gguf.py +441 -441
  22. webscout/Extra/markdownlite/__init__.py +862 -0
  23. webscout/Extra/weather_ascii.py +2 -2
  24. webscout/Provider/AISEARCH/__init__.py +2 -0
  25. webscout/Provider/AISEARCH/ooai.py +155 -0
  26. webscout/Provider/Amigo.py +70 -85
  27. webscout/Provider/{prefind.py → Jadve.py} +72 -70
  28. webscout/Provider/Netwrck.py +235 -0
  29. webscout/Provider/Openai.py +4 -3
  30. webscout/Provider/PI.py +292 -221
  31. webscout/Provider/PizzaGPT.py +3 -3
  32. webscout/Provider/Reka.py +0 -1
  33. webscout/Provider/TTS/__init__.py +5 -1
  34. webscout/Provider/TTS/deepgram.py +183 -0
  35. webscout/Provider/TTS/elevenlabs.py +137 -0
  36. webscout/Provider/TTS/gesserit.py +151 -0
  37. webscout/Provider/TTS/murfai.py +139 -0
  38. webscout/Provider/TTS/parler.py +134 -107
  39. webscout/Provider/TTS/streamElements.py +360 -275
  40. webscout/Provider/TTS/utils.py +280 -0
  41. webscout/Provider/TTS/voicepod.py +116 -116
  42. webscout/Provider/TeachAnything.py +15 -2
  43. webscout/Provider/Youchat.py +42 -8
  44. webscout/Provider/__init__.py +8 -21
  45. webscout/Provider/meta.py +794 -779
  46. webscout/Provider/multichat.py +230 -0
  47. webscout/Provider/promptrefine.py +2 -2
  48. webscout/Provider/talkai.py +10 -13
  49. webscout/Provider/turboseek.py +5 -4
  50. webscout/Provider/tutorai.py +8 -112
  51. webscout/Provider/typegpt.py +5 -7
  52. webscout/Provider/x0gpt.py +81 -9
  53. webscout/Provider/yep.py +123 -361
  54. webscout/__init__.py +33 -28
  55. webscout/conversation.py +24 -9
  56. webscout/exceptions.py +188 -20
  57. webscout/litprinter/__init__.py +719 -831
  58. webscout/litprinter/colors.py +54 -0
  59. webscout/optimizers.py +420 -270
  60. webscout/prompt_manager.py +279 -279
  61. webscout/scout/__init__.py +8 -0
  62. webscout/scout/core/__init__.py +7 -0
  63. webscout/scout/core/crawler.py +140 -0
  64. webscout/scout/core/scout.py +571 -0
  65. webscout/scout/core/search_result.py +96 -0
  66. webscout/scout/core/text_analyzer.py +63 -0
  67. webscout/scout/core/text_utils.py +277 -0
  68. webscout/scout/core/web_analyzer.py +52 -0
  69. webscout/scout/core.py +884 -0
  70. webscout/scout/element.py +460 -0
  71. webscout/scout/parsers/__init__.py +69 -0
  72. webscout/scout/parsers/html5lib_parser.py +172 -0
  73. webscout/scout/parsers/html_parser.py +236 -0
  74. webscout/scout/parsers/lxml_parser.py +178 -0
  75. webscout/scout/utils.py +38 -0
  76. webscout/update_checker.py +184 -125
  77. webscout/version.py +1 -1
  78. webscout/zeroart/__init__.py +55 -0
  79. webscout/zeroart/base.py +60 -0
  80. webscout/zeroart/effects.py +99 -0
  81. webscout/zeroart/fonts.py +816 -0
  82. webscout/zerodir/__init__.py +225 -0
  83. {webscout-6.4.dist-info → webscout-6.6.dist-info}/METADATA +18 -231
  84. webscout-6.6.dist-info/RECORD +197 -0
  85. webscout-6.6.dist-info/top_level.txt +2 -0
  86. webstoken/__init__.py +30 -0
  87. webstoken/classifier.py +189 -0
  88. webstoken/keywords.py +216 -0
  89. webstoken/language.py +128 -0
  90. webstoken/ner.py +164 -0
  91. webstoken/normalizer.py +35 -0
  92. webstoken/processor.py +77 -0
  93. webstoken/sentiment.py +206 -0
  94. webstoken/stemmer.py +73 -0
  95. webstoken/t.py +75 -0
  96. webstoken/tagger.py +60 -0
  97. webstoken/tokenizer.py +158 -0
  98. webscout/Agents/Onlinesearcher.py +0 -182
  99. webscout/Agents/__init__.py +0 -2
  100. webscout/Agents/functioncall.py +0 -248
  101. webscout/Bing_search.py +0 -251
  102. webscout/Provider/Perplexity.py +0 -599
  103. webscout/Provider/RoboCoders.py +0 -206
  104. webscout/Provider/genspark.py +0 -225
  105. webscout/Provider/perplexitylabs.py +0 -265
  106. webscout/Provider/twitterclone.py +0 -251
  107. webscout/Provider/upstage.py +0 -230
  108. webscout/gpt4free.py +0 -666
  109. webscout/requestsHTMLfix.py +0 -775
  110. webscout/webai.py +0 -2590
  111. webscout-6.4.dist-info/RECORD +0 -154
  112. webscout-6.4.dist-info/top_level.txt +0 -1
  113. /webscout/Provider/{felo_search.py → AISEARCH/felo_search.py} +0 -0
  114. {webscout-6.4.dist-info → webscout-6.6.dist-info}/LICENSE.md +0 -0
  115. {webscout-6.4.dist-info → webscout-6.6.dist-info}/WHEEL +0 -0
  116. {webscout-6.4.dist-info → webscout-6.6.dist-info}/entry_points.txt +0 -0
@@ -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
- def tts(self, text: str, description: str = "", use_large: bool = False) -> str:
25
- """
26
- Converts text to speech using the Parler TTS API.
27
-
28
- Args:
29
- text (str): The text to be converted to speech.
30
- description (str, optional): Description of the desired voice characteristics. Defaults to "".
31
- use_large (bool, optional): Whether to use the large model variant. Defaults to False.
32
-
33
- Returns:
34
- str: The filename of the saved audio file.
35
-
36
- Raises:
37
- exceptions.FailedToGenerateResponseError: If there is an error generating or saving the audio.
38
- """
39
- filename = self.audio_cache_dir / f"{int(time.time())}.wav"
40
-
41
- try:
42
- result = self.client.predict(
43
- text=text,
44
- description=description,
45
- use_large=use_large,
46
- api_name=self.api_endpoint,
47
- )
48
-
49
- if isinstance(result, bytes):
50
- audio_bytes = result
51
- elif isinstance(result, str) and os.path.isfile(result):
52
- with open(result, "rb") as f:
53
- audio_bytes = f.read()
54
- else:
55
- raise ValueError(f"Unexpected response from API: {result}")
56
-
57
- self._save_audio(audio_bytes, filename)
58
- return filename.as_posix()
59
-
60
- except Exception as e:
61
- raise exceptions.FailedToGenerateResponseError(
62
- f"Error generating audio after multiple retries: {e}"
63
- ) from e
64
-
65
- def _save_audio(self, audio_data: bytes, filename: Path):
66
- """Saves the audio data to a WAV file in the audio cache directory."""
67
- try:
68
- self.audio_cache_dir.mkdir(parents=True, exist_ok=True)
69
- with open(filename, "wb") as f:
70
- f.write(audio_data)
71
-
72
- except Exception as e:
73
- raise exceptions.FailedToGenerateResponseError(f"Error saving audio: {e}")
74
-
75
- def play_audio(self, filename: str):
76
- """
77
- Plays an audio file using playsound.
78
-
79
- Args:
80
- filename (str): The path to the audio file.
81
-
82
- Raises:
83
- RuntimeError: If there is an error playing the audio.
84
- """
85
- try:
86
- playsound(filename)
87
- except Exception as e:
88
- raise RuntimeError(f"Error playing audio: {e}")
89
-
90
-
91
- # Example usage
92
- if __name__ == "__main__":
93
- parlertts = ParlerTTS()
94
- text = (
95
- "All of the data, pre-processing, training code, and weights are released "
96
- "publicly under a permissive license, enabling the community to build on our work "
97
- "and develop their own powerful models."
98
- )
99
- voice_description = (
100
- "Laura's voice is monotone yet slightly fast in delivery, with a very close "
101
- "recording that almost has no background noise."
102
- )
103
-
104
- print("Generating audio...")
105
- audio_file = parlertts.tts(text, description=voice_description, use_large=False)
106
-
107
- print("Playing audio...")
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)