Ryzenth 1.8.1__py3-none-any.whl → 1.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.
Ryzenth/__init__.py CHANGED
@@ -18,8 +18,8 @@
18
18
  # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
 
20
20
  from . import *
21
- from .ryzenth_client import ApiKeyFrom
22
21
  from .__version__ import __version__
22
+ from .ryzenth_client import ApiKeyFrom
23
23
 
24
24
  __all__ = [
25
25
  "ApiKeyFrom"
Ryzenth/__version__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "1.8.1"
1
+ __version__ = "1.8.3"
2
2
  __author__ = "TeamKillerX"
3
3
  __title__ = "Ryzenth"
4
4
  __description__ = "Ryzenth Python API Wrapper"
Ryzenth/_asynchisded.py CHANGED
@@ -17,20 +17,86 @@
17
17
  # You should have received a copy of the GNU Affero General Public License
18
18
  # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
 
20
- from Ryzenth.types import *
20
+ import logging
21
+
21
22
  import httpx
22
23
 
24
+ from Ryzenth.types import QueryParameter
25
+
26
+ LOGS = logging.getLogger("[Ryzenth] async")
27
+
23
28
  class RyzenthXAsync:
24
- def __init__(self, api_key, base_url="https://randydev-ryu-js.hf.space/api"):
29
+ def __init__(self, api_key: str, base_url: str = "https://randydev-ryu-js.hf.space/api"):
25
30
  self.api_key = api_key
26
- self.base_url = base_url
27
- self.headers = {"x-api-key": f"{self.api_key}"}
31
+ self.base_url = base_url.rstrip("/")
32
+ self.headers = {"x-api-key": self.api_key}
33
+
34
+ async def send_downloader(self, switch_name: str = None, params: QueryParameter = None, list_key=False):
35
+ dl_dict = {
36
+ "teraboxv4": "terabox-v4",
37
+ "twitterv3": "twitter-v3",
38
+ "xnxxinfov2": "xnxx-info-v2",
39
+ "instagramv4": "instagram-v4",
40
+ "instagramv3": "instagram-v3",
41
+ "instagramv2": "instagram-v2",
42
+ "instagram": "instagram",
43
+ "twitter": "twitter",
44
+ "tiktok": "tiktok",
45
+ "tiktokv2": "tiktok-v2",
46
+ "facebook": "fb",
47
+ "snapsave": "snapsave",
48
+ "savefrom": "savefrom"
49
+ }
50
+ if list_key:
51
+ return list(dl_dict.keys())
52
+
53
+ if not switch_name:
54
+ raise ValueError("`switch_name` is required. Use `list_key=True` to see all valid options.")
55
+
56
+ model_name = dl_dict.get(switch_name)
57
+ if not model_name:
58
+ raise ValueError(f"Invalid switch_name: {switch_name}")
59
+
60
+ async with httpx.AsyncClient() as client:
61
+ try:
62
+ response = await client.get(
63
+ f"{self.base_url}/v1/dl/{model_name}",
64
+ params=params.dict(),
65
+ headers=self.headers,
66
+ timeout=10
67
+ )
68
+ response.raise_for_status()
69
+ return response.json()
70
+ except httpx.HTTPError as e:
71
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
72
+ return None
73
+
74
+ async def send_message(self, model: str = None, params: QueryParameter = None, list_key=False):
75
+ model_dict = {
76
+ "hybrid": "AkenoX-1.9-Hybrid",
77
+ "melayu": "lu-melayu",
78
+ "nocodefou": "nocodefou",
79
+ "mia": "mia-khalifah",
80
+ "curlmcode": "curl-command-code",
81
+ "quotessad": "quotes-sad",
82
+ "quoteslucu": "quotes-lucu",
83
+ "lirikend": "lirik-end",
84
+ "alsholawat": "al-sholawat"
85
+ }
86
+ if list_key:
87
+ return list(model_dict.keys())
88
+
89
+ if not model:
90
+ raise ValueError("`model` is required. Use `list_key=True` to see all valid options.")
91
+
92
+ model_param = model_dict.get(model)
93
+ if not model_param:
94
+ raise ValueError(f"Invalid model name: {model}")
28
95
 
29
- async def send_message_hybrid(self, text: str):
30
96
  async with httpx.AsyncClient() as client:
31
97
  try:
32
98
  response = await client.get(
33
- f"{self.base_url}/v1/ai/akenox/AkenoX-1.9-Hybrid",
99
+ f"{self.base_url}/v1/ai/akenox/{model_param}",
34
100
  params=params.dict(),
35
101
  headers=self.headers,
36
102
  timeout=10
@@ -38,5 +104,5 @@ class RyzenthXAsync:
38
104
  response.raise_for_status()
39
105
  return response.json()
40
106
  except httpx.HTTPError as e:
41
- print(f"[ASYNC] Error: {e}")
107
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
42
108
  return None
Ryzenth/_synchisded.py CHANGED
@@ -17,19 +17,83 @@
17
17
  # You should have received a copy of the GNU Affero General Public License
18
18
  # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
 
20
- from Ryzenth.types import *
20
+ import logging
21
+
21
22
  import httpx
22
23
 
24
+ from Ryzenth.types import QueryParameter
25
+
26
+ LOGS = logging.getLogger("[Ryzenth] sync")
27
+
23
28
  class RyzenthXSync:
24
- def __init__(self, api_key, base_url="https://randydev-ryu-js.hf.space/api"):
29
+ def __init__(self, api_key: str, base_url: str = "https://randydev-ryu-js.hf.space/api"):
25
30
  self.api_key = api_key
26
- self.base_url = base_url
27
- self.headers = {"x-api-key": f"{self.api_key}"}
31
+ self.base_url = base_url.rstrip("/")
32
+ self.headers = {"x-api-key": self.api_key}
33
+
34
+ def send_downloader(self, switch_name: str = None, params: QueryParameter = None, list_key=False):
35
+ dl_dict = {
36
+ "teraboxv4": "terabox-v4",
37
+ "twitterv3": "twitter-v3",
38
+ "xnxxinfov2": "xnxx-info-v2",
39
+ "instagramv4": "instagram-v4",
40
+ "instagramv3": "instagram-v3",
41
+ "instagramv2": "instagram-v2",
42
+ "instagram": "instagram",
43
+ "twitter": "twitter",
44
+ "tiktok": "tiktok",
45
+ "tiktokv2": "tiktok-v2",
46
+ "facebook": "fb",
47
+ "snapsave": "snapsave",
48
+ "savefrom": "savefrom"
49
+ }
50
+ if list_key:
51
+ return list(dl_dict.keys())
52
+
53
+ if not switch_name:
54
+ raise ValueError("`switch_name` is required. Use `list_key=True` to see all valid options.")
55
+
56
+ model_name = dl_dict.get(switch_name)
57
+ if not model_name:
58
+ raise ValueError(f"Invalid switch_name: {switch_name}")
59
+ try:
60
+ response = httpx.get(
61
+ f"{self.base_url}/v1/dl/{model_name}",
62
+ params=params.dict(),
63
+ headers=self.headers,
64
+ timeout=10
65
+ )
66
+ response.raise_for_status()
67
+ return response.json()
68
+ except httpx.HTTPError as e:
69
+ LOGS.error(f"[SYNC] Error fetching from downloader {e}")
70
+ return None
71
+
72
+ def send_message(self, model: str = None, params: QueryParameter = None, list_key=False):
73
+ model_dict = {
74
+ "hybrid": "AkenoX-1.9-Hybrid",
75
+ "melayu": "lu-melayu",
76
+ "nocodefou": "nocodefou",
77
+ "mia": "mia-khalifah",
78
+ "curlmcode": "curl-command-code",
79
+ "quotessad": "quotes-sad",
80
+ "quoteslucu": "quotes-lucu",
81
+ "lirikend": "lirik-end",
82
+ "alsholawat": "al-sholawat"
83
+ }
84
+ if list_key:
85
+ return list(model_dict.keys())
86
+
87
+ if not model:
88
+ raise ValueError("`model` is required. Use `list_key=True` to see all valid options.")
89
+
90
+ model_param = model_dict.get(model)
91
+ if not model_param:
92
+ raise ValueError(f"Invalid model name: {model}")
28
93
 
29
- def send_message_hybrid(self, params: HybridParams):
30
94
  try:
31
95
  response = httpx.get(
32
- f"{self.base_url}/v1/ai/akenox/AkenoX-1.9-Hybrid",
96
+ f"{self.base_url}/v1/ai/akenox/{model_param}",
33
97
  params=params.dict(),
34
98
  headers=self.headers,
35
99
  timeout=10
@@ -37,5 +101,5 @@ class RyzenthXSync:
37
101
  response.raise_for_status()
38
102
  return response.json()
39
103
  except httpx.HTTPError as e:
40
- print(f"[SYNC] Error: {e}")
104
+ LOGS.error(f"[SYNC] Error fetching from akenox: {e}")
41
105
  return None
Ryzenth/ryzenth_client.py CHANGED
@@ -19,8 +19,9 @@
19
19
 
20
20
  import os
21
21
 
22
- from Ryzenth._synchisded import RyzenthXSync
23
22
  from Ryzenth._asynchisded import RyzenthXAsync
23
+ from Ryzenth._synchisded import RyzenthXSync
24
+
24
25
 
25
26
  class ApiKeyFrom:
26
27
  def __init__(self, api_key: str = None):
Ryzenth/types/__init__.py CHANGED
@@ -18,9 +18,11 @@
18
18
  # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
 
20
20
 
21
+ from typing import Any, Optional
22
+
21
23
  from pydantic import BaseModel
22
- from typing import Optional
23
24
 
24
- class HybridParams(BaseModel):
25
- query: str
26
-
25
+
26
+ class QueryParameter(BaseModel):
27
+ query: Optional[str] = None
28
+ url: Optional[str] = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Ryzenth
3
- Version: 1.8.1
3
+ Version: 1.8.3
4
4
  Summary: Ryzenth Python Wrapper For Perfomance
5
5
  Author: TeamKillerX
6
6
  License: MIT
@@ -54,7 +54,7 @@ Dynamic: summary
54
54
 
55
55
  # Ryzenth Library
56
56
 
57
- **Ryzenth** is a powerful and flexible Python SDK for interacting with the new **Ryzenth API**a successor to the AkenoX API supporting both synchronous and asynchronous workflows out of the box.
57
+ **Ryzenth** is a powerful and flexible Python SDK for interacting with the new **Ryzenth API** a successor to the AkenoX API supporting both synchronous and asynchronous workflows out of the box.
58
58
 
59
59
  > Note: AkenoX API is still alive and supported, but Ryzenth is the next generation.
60
60
 
@@ -68,7 +68,7 @@ Dynamic: summary
68
68
  ## Installation
69
69
 
70
70
  ```bash
71
- pip install ryzenth
71
+ pip install ryzenth[fast]
72
72
  ````
73
73
 
74
74
  ## Getting Started
@@ -77,21 +77,35 @@ pip install ryzenth
77
77
 
78
78
  ```python
79
79
  from Ryzenth import ApiKeyFrom
80
+ from Ryzenth.types import QueryParameter
80
81
 
81
82
  ryz = ApiKeyFrom("your-api-key")
82
- await ryz.aio.send_message_hybrid("Hello from Ryzenth!")
83
+
84
+ await ryz.aio.send_message(
85
+ "hybrid",
86
+ QueryParameter(
87
+ query="hello world!"
88
+ )
89
+ )
83
90
  ```
84
91
 
85
92
  ### Sync Example
86
93
 
87
94
  ```python
88
95
  from Ryzenth import ApiKeyFrom
96
+ from Ryzenth.types import QueryParameter
89
97
 
90
98
  ryz = ApiKeyFrom("your-api-key")
91
- ryz._sync.send_message_hybrid("Hello from Ryzenth (sync)!")
99
+ ryz._sync.send_message(
100
+ "hybrid",
101
+ QueryParameter(
102
+ query="hello world!"
103
+ )
104
+ )
92
105
  ```
93
106
 
94
107
  ## Environment Variable Support
108
+ - Available API key v2 via [`@aknuserbot`](https://t.me/aknuserbot)
95
109
 
96
110
  You can skip passing the API key directly by setting it via environment:
97
111
 
@@ -0,0 +1,11 @@
1
+ Ryzenth/__init__.py,sha256=-_DvsIrYN1rtnUJzhhgRjdCspuD26jh_AbQBtDkmoyo,944
2
+ Ryzenth/__version__.py,sha256=If0AyuBSroe8Pv0wRejh5VqDLnuaW4c2SDdS63OqUEM,118
3
+ Ryzenth/_asynchisded.py,sha256=JxNw0lAmzhnWh2WjeKPHETu6N8MorJv3rdEfWai8zxg,3989
4
+ Ryzenth/_synchisded.py,sha256=kLKL9b5dyMt_j5ew4Of5Y5hkFSDvmA43XjnmjT2Iab0,3797
5
+ Ryzenth/ryzenth_client.py,sha256=fN_0BcK0ao6-CTpe5bRCT9jQD7Krr_Q8-Xlf-aFqdZY,1225
6
+ Ryzenth/types/__init__.py,sha256=Uq5xqwfI5f-QwEnDRycQFJ5_yJbwzZwsM4cqgo_Wpbw,985
7
+ ryzenth-1.8.3.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
8
+ ryzenth-1.8.3.dist-info/METADATA,sha256=eYxGY-jCsrG4xQQ0g3QBFE-RoyOK1ppfcXz0DMofWME,3262
9
+ ryzenth-1.8.3.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
10
+ ryzenth-1.8.3.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
11
+ ryzenth-1.8.3.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- Ryzenth/__init__.py,sha256=GHr2eIrtZp0amBwj1qsvSGxCDkZM6iMjNBan5CdJYXA,944
2
- Ryzenth/__version__.py,sha256=69dfO52GCQeqgHIHeMb7JHNZg16O-u-lrZzoqaZ4cuI,118
3
- Ryzenth/_asynchisded.py,sha256=9j87R977IKzZhBdNeSDbQmGVUnB981gZ6Uwthyb9jgY,1653
4
- Ryzenth/_synchisded.py,sha256=35sZjFm2HtgdGFUN-pLGbnEmXgBt--MckFHlpjbxTOw,1551
5
- Ryzenth/ryzenth_client.py,sha256=SGq63zu6HW2CHl23ODBRcgDeocPqXzwcXMUDVcMza3A,1224
6
- Ryzenth/types/__init__.py,sha256=pAiFktEAU2VRmZC7Ig9YCypR2IwNARWnhWJQzGLqX_Q,932
7
- ryzenth-1.8.1.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
8
- ryzenth-1.8.1.dist-info/METADATA,sha256=wDfsej2RzbJN2cgXRUT27_eNf5TTnufVtRdq8wKWZ3Q,3035
9
- ryzenth-1.8.1.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
10
- ryzenth-1.8.1.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
11
- ryzenth-1.8.1.dist-info/RECORD,,