webscout 1.3.6__py3-none-any.whl → 1.3.9__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/AI.py +2928 -919
- webscout/AIbase.py +69 -1
- webscout/AIutel.py +317 -3
- webscout/__init__.py +2 -2
- webscout/async_providers.py +33 -0
- webscout/exceptions.py +4 -1
- webscout/g4f.py +665 -473
- webscout/version.py +1 -1
- webscout/voice.py +26 -26
- webscout/webai.py +2437 -2360
- {webscout-1.3.6.dist-info → webscout-1.3.9.dist-info}/METADATA +8 -19
- {webscout-1.3.6.dist-info → webscout-1.3.9.dist-info}/RECORD +16 -16
- webscout/HelpingAI.py +0 -192
- {webscout-1.3.6.dist-info → webscout-1.3.9.dist-info}/LICENSE.md +0 -0
- {webscout-1.3.6.dist-info → webscout-1.3.9.dist-info}/WHEEL +0 -0
- {webscout-1.3.6.dist-info → webscout-1.3.9.dist-info}/entry_points.txt +0 -0
- {webscout-1.3.6.dist-info → webscout-1.3.9.dist-info}/top_level.txt +0 -0
webscout/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "1.3.
|
|
1
|
+
__version__ = "1.3.9"
|
|
2
2
|
|
webscout/voice.py
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import requests
|
|
2
|
-
import typing
|
|
3
|
-
|
|
4
|
-
def play_audio(message: str, voice: str = "Brian") -> typing.Union[str, typing.NoReturn]:
|
|
5
|
-
"""
|
|
6
|
-
Text to speech using StreamElements API
|
|
7
|
-
|
|
8
|
-
Parameters:
|
|
9
|
-
message (str): The text to convert to speech
|
|
10
|
-
voice (str): The voice to use for speech synthesis. Default is "Brian".
|
|
11
|
-
|
|
12
|
-
Returns:
|
|
13
|
-
result (Union[str, None]): Temporary file path or None in failure
|
|
14
|
-
"""
|
|
15
|
-
# Base URL for provider API
|
|
16
|
-
url: str = f"https://api.streamelements.com/kappa/v2/speech?voice={voice}&text={{{message}}}"
|
|
17
|
-
|
|
18
|
-
# Request headers
|
|
19
|
-
headers: typing.Dict[str, str] = {
|
|
20
|
-
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
|
|
21
|
-
}
|
|
22
|
-
# Try to send request or return None on failure
|
|
23
|
-
try:
|
|
24
|
-
result = requests.get(url=url, headers=headers)
|
|
25
|
-
return result.content
|
|
26
|
-
except:
|
|
1
|
+
import requests
|
|
2
|
+
import typing
|
|
3
|
+
|
|
4
|
+
def play_audio(message: str, voice: str = "Brian") -> typing.Union[str, typing.NoReturn]:
|
|
5
|
+
"""
|
|
6
|
+
Text to speech using StreamElements API
|
|
7
|
+
|
|
8
|
+
Parameters:
|
|
9
|
+
message (str): The text to convert to speech
|
|
10
|
+
voice (str): The voice to use for speech synthesis. Default is "Brian".
|
|
11
|
+
|
|
12
|
+
Returns:
|
|
13
|
+
result (Union[str, None]): Temporary file path or None in failure
|
|
14
|
+
"""
|
|
15
|
+
# Base URL for provider API
|
|
16
|
+
url: str = f"https://api.streamelements.com/kappa/v2/speech?voice={voice}&text={{{message}}}"
|
|
17
|
+
|
|
18
|
+
# Request headers
|
|
19
|
+
headers: typing.Dict[str, str] = {
|
|
20
|
+
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
|
|
21
|
+
}
|
|
22
|
+
# Try to send request or return None on failure
|
|
23
|
+
try:
|
|
24
|
+
result = requests.get(url=url, headers=headers)
|
|
25
|
+
return result.content
|
|
26
|
+
except:
|
|
27
27
|
return None
|