Ryzenth 2.0.1__py3-none-any.whl → 2.0.2__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/__version__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "2.0.1"
1
+ __version__ = "2.0.2"
2
2
  __author__ = "TeamKillerX"
3
3
  __title__ = "Ryzenth"
4
4
  __description__ = "Ryzenth Python API Wrapper"
Ryzenth/_asynchisded.py CHANGED
@@ -34,7 +34,7 @@ from .helper import (
34
34
  WhatAsync,
35
35
  WhisperAsync,
36
36
  )
37
- from .types import DownloaderBy, QueryParameter, Username
37
+ from .types import DownloaderBy, QueryParameter, RequestXnxx, Username
38
38
 
39
39
 
40
40
  class RyzenthXAsync:
@@ -66,7 +66,13 @@ class RyzenthXAsync:
66
66
  self,
67
67
  switch_name: str,
68
68
  *,
69
- params: Union[DownloaderBy, QueryParameter, Username] = None,
69
+ params: Union[
70
+ DownloaderBy,
71
+ QueryParameter,
72
+ Username,
73
+ RequestXnxx
74
+ ] = None,
75
+ params_only=True,
70
76
  on_render=False,
71
77
  dot_access=False
72
78
  ):
@@ -78,7 +84,12 @@ class RyzenthXAsync:
78
84
 
79
85
  async with httpx.AsyncClient() as client:
80
86
  try:
81
- response = await self._client_downloader_get(client, params, model_name)
87
+ response = await self._client_downloader_get(
88
+ client,
89
+ params,
90
+ params_only,
91
+ model_name
92
+ )
82
93
  response.raise_for_status()
83
94
  return self.obj(response.json() or {}) if dot_access else response.json()
84
95
  except httpx.HTTPError as e:
@@ -93,10 +104,10 @@ class RyzenthXAsync:
93
104
  timeout=self.timeout
94
105
  )
95
106
 
96
- async def _client_downloader_get(self, client, params, model_param):
107
+ async def _client_downloader_get(self, client, params, params_only, model_param):
97
108
  return await client.get(
98
109
  f"{self.base_url}/v1/dl/{model_param}",
99
- params=params.model_dump(),
110
+ params=params.model_dump() if params_only else None,
100
111
  headers=self.headers,
101
112
  timeout=self.timeout
102
113
  )
Ryzenth/_shared.py CHANGED
@@ -15,7 +15,9 @@ BASE_DICT_RENDER = {
15
15
  "pinterest-search": "pinterest-search-dl", #query #render
16
16
  "tiktok-search": "tiktok-search-dl", #query #render
17
17
  "yt-username": "yt-username", #username #render
18
- "tiktok-username": "tiktok-username" #username #render
18
+ "tiktok-username": "tiktok-username", #username #render
19
+ "xnxx-dl": "xnxx-dl", #types optional #render
20
+ "hentai-anime": "hentai-anime" #None, render
19
21
  }
20
22
 
21
23
  BASE_DICT_OFFICIAL = {
Ryzenth/_synchisded.py CHANGED
@@ -34,7 +34,7 @@ from .helper import (
34
34
  WhatSync,
35
35
  WhisperSync,
36
36
  )
37
- from .types import DownloaderBy, QueryParameter, Username
37
+ from .types import DownloaderBy, QueryParameter, RequestXnxx, Username
38
38
 
39
39
 
40
40
  class RyzenthXSync:
@@ -66,7 +66,13 @@ class RyzenthXSync:
66
66
  self,
67
67
  switch_name: str,
68
68
  *,
69
- params: Union[DownloaderBy, QueryParameter, Username] = None,
69
+ params: Union[
70
+ DownloaderBy,
71
+ QueryParameter,
72
+ Username,
73
+ RequestXnxx
74
+ ] = None,
75
+ params_only=True,
70
76
  on_render=False,
71
77
  dot_access=False
72
78
  ):
@@ -77,7 +83,7 @@ class RyzenthXSync:
77
83
  try:
78
84
  response = httpx.get(
79
85
  f"{self.base_url}/v1/dl/{model_name}",
80
- params=params.model_dump(),
86
+ params=params.model_dump() if params_only else None,
81
87
  headers=self.headers,
82
88
  timeout=self.timeout
83
89
  )
Ryzenth/helper/_images.py CHANGED
@@ -25,27 +25,36 @@ class ImagesAsync:
25
25
  def __init__(self, parent):
26
26
  self.parent = parent
27
27
 
28
- async def generate(self, params: QueryParameter):
28
+ async def generate(self, params: QueryParameter) -> bytes:
29
29
  url = f"{self.parent.base_url}/v1/flux/black-forest-labs/flux-1-schnell"
30
30
  async with self.parent.httpx.AsyncClient() as client:
31
31
  try:
32
- response = await client.get(url, params=params.dict(), headers=self.parent.headers, timeout=self.parent.timeout)
32
+ response = await client.get(
33
+ url,
34
+ params=params.model_dump(),
35
+ headers=self.parent.headers,
36
+ timeout=self.parent.timeout
37
+ )
33
38
  response.raise_for_status()
34
39
  return response.content
35
40
  except self.parent.httpx.HTTPError as e:
36
41
  self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
37
42
  raise WhatFuckError("[ASYNC] Error fetching") from e
38
43
 
44
+ async def to_save(self, params: QueryParameter, file_path="fluxai.jpg"):
45
+ content = await self.generate(params)
46
+ return ResponseFileImage(content).to_save(file_path)
47
+
39
48
  class ImagesSync:
40
49
  def __init__(self, parent):
41
50
  self.parent = parent
42
51
 
43
- def generate(self, params: QueryParameter):
52
+ def generate(self, params: QueryParameter) -> bytes:
44
53
  url = f"{self.parent.base_url}/v1/flux/black-forest-labs/flux-1-schnell"
45
54
  try:
46
55
  response = self.parent.httpx.get(
47
56
  url,
48
- params=params.dict(),
57
+ params=params.model_dump(),
49
58
  headers=self.parent.headers,
50
59
  timeout=self.parent.timeout
51
60
  )
@@ -54,3 +63,17 @@ class ImagesSync:
54
63
  except self.parent.httpx.HTTPError as e:
55
64
  self.parent.logger.error(f"[SYNC] Error fetching from images {e}")
56
65
  raise WhatFuckError("[SYNC] Error fetching from images") from e
66
+
67
+ def to_save(self, params: QueryParameter, file_path="fluxai.jpg"):
68
+ content = self.generate(params)
69
+ return ResponseFileImage(content).to_save(file_path)
70
+
71
+
72
+ class ResponseFileImage:
73
+ def __init__(self, response_content: bytes):
74
+ self.response_content = response_content
75
+
76
+ def to_save(self, file_path="fluxai.jpg"):
77
+ with open(file_path, "wb") as f:
78
+ f.write(self.response_content)
79
+ return file_path
Ryzenth/helper/_openai.py CHANGED
@@ -31,7 +31,7 @@ class WhisperAsync:
31
31
  try:
32
32
  response = await client.get(
33
33
  url,
34
- params=params.dict(),
34
+ params=params.model_dump(),
35
35
  headers=self.parent.headers,
36
36
  timeout=self.parent.timeout
37
37
  )
@@ -50,7 +50,7 @@ class WhisperSync:
50
50
  try:
51
51
  response = self.parent.httpx.get(
52
52
  url,
53
- params=params.dict(),
53
+ params=params.model_dump(),
54
54
  headers=self.parent.headers,
55
55
  timeout=self.parent.timeout
56
56
  )
@@ -1,5 +1,5 @@
1
1
  from Ryzenth._synchisded import RyzenthXSync
2
- from Ryzenth.types import QueryParameter, Username
2
+ from Ryzenth.types import QueryParameter, RequestXnxx, Username
3
3
 
4
4
 
5
5
  def test_send_downloader():
@@ -23,3 +23,25 @@ def test_yt_username():
23
23
  on_render=True
24
24
  )
25
25
  assert result is not None
26
+
27
+ def test_hentai_anime():
28
+ ryz = RyzenthXSync("test", base_url="https://x-api-js.onrender.com/api")
29
+ result = ryz.send_downloader(
30
+ switch_name="hentai-anime",
31
+ params=None,
32
+ params_only=False,
33
+ on_render=True
34
+ )
35
+ assert result is not None
36
+
37
+ def test_xnxxdl():
38
+ ryz = RyzenthXSync("test", base_url="https://x-api-js.onrender.com/api")
39
+ result = ryz.send_downloader(
40
+ switch_name="xnxx-dl",
41
+ params=RequestXnxx(
42
+ query="boobs",
43
+ is_download=False
44
+ ),
45
+ on_render=True
46
+ )
47
+ assert result is not None
Ryzenth/types/__init__.py CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  from typing import Any, Optional
22
22
 
23
- from pydantic import BaseModel
23
+ from pydantic import BaseModel, Field
24
24
 
25
25
 
26
26
  class QueryParameter(BaseModel):
@@ -37,6 +37,11 @@ class OpenaiWhisper(BaseModel):
37
37
  language: Optional[str] = None
38
38
  task: Optional[str] = None
39
39
 
40
+ class RequestXnxx(BaseModel):
41
+ query: str
42
+ is_download: bool = Field(False, alias="isDownload")
43
+ url: Optional[str] = None
44
+
40
45
  class RequestHumanizer(BaseModel):
41
46
  text: str
42
47
  writing_style: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Ryzenth
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: Ryzenth Python Wrapper For Perfomance
5
5
  Author: TeamKillerX
6
6
  License: MIT
@@ -1,17 +1,17 @@
1
1
  Ryzenth/__init__.py,sha256=vM1IVkgRFQT5o15KYKx8kY59114Jw5taP8ytm9YJy94,996
2
- Ryzenth/__version__.py,sha256=7TfjoHIGnI-uQvSrKq8eS0RolxAcGgJ9hf1YEC2zsYg,118
3
- Ryzenth/_asynchisded.py,sha256=QmPWelWBvm6EAx0HDBBVWD20bUCZZY0xUPxSWYv_G3c,4686
2
+ Ryzenth/__version__.py,sha256=Nectpr0IFeoxYbiVVqKO_wyuoU3bX3HGYudTPZQiIus,118
3
+ Ryzenth/_asynchisded.py,sha256=FiEkjfkgSUaUERgJz1l9TRPIN1yi0qG-Kzk1sW4OgxU,4929
4
4
  Ryzenth/_client.py,sha256=1DhB0Ey-XM8kSpP3ztNkGkrevyLssdFAwLf4mjI6DWU,1867
5
5
  Ryzenth/_errors.py,sha256=PwXVGoRQQYw05YYsh7bCRxr3jpV5k31fXCNNweag8LY,1456
6
- Ryzenth/_shared.py,sha256=TeI0F7E_yzWXmYIQP4dsKqB2h2c0kkCfKgsssnfCe3Y,1582
7
- Ryzenth/_synchisded.py,sha256=o6R1-CCkXLs83TE6xAKTyiWiETx98OS8DfnYilqELhU,4681
6
+ Ryzenth/_shared.py,sha256=zlERjX4XmYsDbkei8BRQ_-G1ozPlsn0SSalsAN6roT0,1682
7
+ Ryzenth/_synchisded.py,sha256=iN-nyZMPW7KawYd5gBzskxj0NNOqhN5ddNzBFKGAxHk,4800
8
8
  Ryzenth/helper/__init__.py,sha256=BkP6fQ3IJnOqyXn07jD7anumVPlm8lVPNkFnK9b6XpE,1447
9
9
  Ryzenth/helper/_decorators.py,sha256=rEdJRoQrJfqd4LqNOiFfPwEQwMU4uVuEsoqRuQfw99I,2125
10
10
  Ryzenth/helper/_federation.py,sha256=pfqqGjg179f-olvW1Z7aX1nQf0GQJdSK4NDMaMDxmbA,14552
11
11
  Ryzenth/helper/_fonts.py,sha256=Yy5qWdumGf0Y7tcvEXGLSn87mKlr-x_gmO241a465j8,3035
12
- Ryzenth/helper/_images.py,sha256=oOqojWiiYMZja1LloY_c-qIbH-s35yENohpBbZYDHCc,2305
12
+ Ryzenth/helper/_images.py,sha256=sDIqo964oDeLvhf1XtJ1khNgSuYXSzmQY9w_jJS89fI,3073
13
13
  Ryzenth/helper/_moderator.py,sha256=fAi0Xxk6CSShXl94H0FT8oDn6FttVq3ysBiROjSesCw,5501
14
- Ryzenth/helper/_openai.py,sha256=cbQkEZ_B4NQEnnqG4Wobf_k6HLtKfpeMRJ8vFPuEWUQ,2570
14
+ Ryzenth/helper/_openai.py,sha256=YkoW40X7Hgo_gQCWqrxHAe_uTx1fR5AyFAZh2MMiNJo,2582
15
15
  Ryzenth/helper/_ryzenth.py,sha256=VPjo09JOjtzS74AxUwcXsaWFGY923_scqZ2ujzBEa3A,2874
16
16
  Ryzenth/helper/_thinking.py,sha256=OTmV9FQYVbsWupZA-jvywWJBdO6UyioVBkBMsFazBWQ,2566
17
17
  Ryzenth/pyoraddons/__init__.py,sha256=Xt4w4YHoFKwMZe8QslhLKp6mHBjBowvYjzkN95ikpjU,3175
@@ -19,10 +19,10 @@ Ryzenth/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  Ryzenth/tests/test_deepseek.py,sha256=_KbYr-haKBt5Xc-YULBL9Ic5OM02SX17hvQWWjYpNAk,255
20
20
  Ryzenth/tests/test_moderator.py,sha256=wc9A_0gx3LobMD7CDS-h2eTNPNYxeJk_rqtd2QTt428,291
21
21
  Ryzenth/tests/test_send.py,sha256=yPQV3XRsPKBo4eSsz5kc2R6BEuru0zmMexYshX0Ac3s,573
22
- Ryzenth/tests/test_send_downloader.py,sha256=hGlRK3diXmJLsSnbeuNsJh1YoZqhe2E8W7NNokMNoaQ,708
23
- Ryzenth/types/__init__.py,sha256=G99dsLqka-fu9T3dtQO7---oTUQF2ygzea9DAwrJ48U,1252
24
- ryzenth-2.0.1.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
25
- ryzenth-2.0.1.dist-info/METADATA,sha256=pmc45mRVte-O2AoRAsFoagXWzWanHmCO-6PJGvjMLbQ,4390
26
- ryzenth-2.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
- ryzenth-2.0.1.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
28
- ryzenth-2.0.1.dist-info/RECORD,,
22
+ Ryzenth/tests/test_send_downloader.py,sha256=23Lkq6bkh5SVDZ2hRH1Q3nlqpl-dqqGMSznDkmgDbhc,1318
23
+ Ryzenth/types/__init__.py,sha256=2q3Oy7wCtgHa1cVY1JVN6cJht7uEAva3yFijSiJxYdI,1392
24
+ ryzenth-2.0.2.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
25
+ ryzenth-2.0.2.dist-info/METADATA,sha256=lBPbgE8B-b6NIa056bG4g3SU12FU5Il3zBY1osuG1s8,4390
26
+ ryzenth-2.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
+ ryzenth-2.0.2.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
28
+ ryzenth-2.0.2.dist-info/RECORD,,