simple-rule34 0.1.6__tar.gz → 0.1.6.1__tar.gz
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.
- {simple_rule34-0.1.6/src/simple_rule34.egg-info → simple_rule34-0.1.6.1}/PKG-INFO +3 -2
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/pyproject.toml +1 -1
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/src/SimpleRule34/Rule34.py +6 -4
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1/src/simple_rule34.egg-info}/PKG-INFO +3 -2
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/LICENSE +0 -0
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/README.md +0 -0
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/setup.cfg +0 -0
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/src/SimpleRule34/__init__.py +0 -0
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/src/SimpleRule34/exceptions.py +0 -0
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/src/SimpleRule34/types.py +0 -0
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/src/SimpleRule34/utils.py +0 -0
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/src/__init__.py +0 -0
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/src/simple_rule34.egg-info/SOURCES.txt +0 -0
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/src/simple_rule34.egg-info/dependency_links.txt +0 -0
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/src/simple_rule34.egg-info/requires.txt +0 -0
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/src/simple_rule34.egg-info/top_level.txt +0 -0
- {simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/tests/test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: simple_rule34
|
|
3
|
-
Version: 0.1.6
|
|
3
|
+
Version: 0.1.6.1
|
|
4
4
|
Summary: Simple api wrapper of rule34.xxx for python with asynchronous support
|
|
5
5
|
Author-email: StarMan12 <author@example.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/SyperAlexKomp/simple-rule34-api
|
|
@@ -52,6 +52,7 @@ Requires-Dist: yarl==1.9.2
|
|
|
52
52
|
Requires-Dist: zipp==3.16.2
|
|
53
53
|
Requires-Dist: aiofiles~=23.2.1
|
|
54
54
|
Requires-Dist: pydantic~=2.7.1
|
|
55
|
+
Dynamic: license-file
|
|
55
56
|
|
|
56
57
|
# rule34-simple-api
|
|
57
58
|
Simple api wrapper of rule34.xxx for python with asynchronous support
|
|
@@ -11,12 +11,14 @@ from .types import *
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class Rule34Api:
|
|
14
|
-
def __init__(self):
|
|
14
|
+
def __init__(self, api_str: str):
|
|
15
15
|
self.header = {'User-Agent': 'rule34-simple-api 0.1.5.6 (Request)'}
|
|
16
|
+
self.api_str = api_str
|
|
17
|
+
|
|
16
18
|
async def get_post_count(self, tags: str = '') -> int:
|
|
17
19
|
async with aiohttp.ClientSession(headers=self.header) as session:
|
|
18
20
|
async with session.get(f'https://api.rule34.xxx/index.php?'
|
|
19
|
-
f'page=dapi&s=post&q=index&tags={tags}') as response:
|
|
21
|
+
f'page=dapi&s=post&q=index&tags={tags}&{self.api_str}') as response:
|
|
20
22
|
xml_data = await response.text()
|
|
21
23
|
|
|
22
24
|
xml_root = ET.fromstring(xml_data)
|
|
@@ -28,7 +30,7 @@ class Rule34Api:
|
|
|
28
30
|
|
|
29
31
|
async with aiohttp.ClientSession(headers=self.header) as session:
|
|
30
32
|
async with session.get(f'https://api.rule34.xxx/index.php?'
|
|
31
|
-
f'json=1&page=dapi&s=post&q=index&id={id}') as response:
|
|
33
|
+
f'json=1&page=dapi&s=post&q=index&id={id}&{self.api_str}') as response:
|
|
32
34
|
if response.status != 200:
|
|
33
35
|
raise ApiException(f"Api returned status code {response.status} with message"
|
|
34
36
|
f" {await response.text()}")
|
|
@@ -113,7 +115,7 @@ class Rule34Api:
|
|
|
113
115
|
start_time = time.time()
|
|
114
116
|
|
|
115
117
|
async with session.get(f'https://api.rule34.xxx/index.php?'
|
|
116
|
-
f'json=1&page=dapi&s=post&q=index&limit={limit}&pid={page_id}&tags={tags}') as response:
|
|
118
|
+
f'json=1&page=dapi&s=post&q=index&limit={limit}&pid={page_id}&tags={tags}&{self.api_str}') as response:
|
|
117
119
|
if response.status != 200:
|
|
118
120
|
raise ApiException(f"Api returned status code {response.status} with message"
|
|
119
121
|
f" {await response.text()}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: simple_rule34
|
|
3
|
-
Version: 0.1.6
|
|
3
|
+
Version: 0.1.6.1
|
|
4
4
|
Summary: Simple api wrapper of rule34.xxx for python with asynchronous support
|
|
5
5
|
Author-email: StarMan12 <author@example.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/SyperAlexKomp/simple-rule34-api
|
|
@@ -52,6 +52,7 @@ Requires-Dist: yarl==1.9.2
|
|
|
52
52
|
Requires-Dist: zipp==3.16.2
|
|
53
53
|
Requires-Dist: aiofiles~=23.2.1
|
|
54
54
|
Requires-Dist: pydantic~=2.7.1
|
|
55
|
+
Dynamic: license-file
|
|
55
56
|
|
|
56
57
|
# rule34-simple-api
|
|
57
58
|
Simple api wrapper of rule34.xxx for python with asynchronous support
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_rule34-0.1.6 → simple_rule34-0.1.6.1}/src/simple_rule34.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|