simple-rule34 1.0.0.2__tar.gz → 1.0.0.4__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-1.0.0.2/src/simple_rule34.egg-info → simple_rule34-1.0.0.4}/PKG-INFO +2 -2
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/pyproject.toml +2 -2
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/src/SimpleRule34/main.py +2 -0
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/src/SimpleRule34/types.py +13 -2
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4/src/simple_rule34.egg-info}/PKG-INFO +2 -2
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/LICENSE +0 -0
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/README.md +0 -0
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/setup.cfg +0 -0
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/src/SimpleRule34/__init__.py +0 -0
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/src/SimpleRule34/exceptions.py +0 -0
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/src/SimpleRule34/utils.py +0 -0
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/src/__init__.py +0 -0
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/src/simple_rule34.egg-info/SOURCES.txt +0 -0
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/src/simple_rule34.egg-info/dependency_links.txt +0 -0
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/src/simple_rule34.egg-info/requires.txt +0 -0
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/src/simple_rule34.egg-info/top_level.txt +0 -0
- {simple_rule34-1.0.0.2 → simple_rule34-1.0.0.4}/tests/test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: simple_rule34
|
|
3
|
-
Version: 1.0.0.
|
|
3
|
+
Version: 1.0.0.4
|
|
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
|
|
@@ -8,7 +8,7 @@ Project-URL: Bug Tracker, https://github.com/SyperAlexKomp/simple-rule34-api/iss
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: aiofiles~=25.1.0
|
|
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "simple_rule34"
|
|
7
|
-
version = "1.0.0.
|
|
7
|
+
version = "1.0.0.4"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="StarMan12", email="author@example.com" },
|
|
10
10
|
]
|
|
11
11
|
description = "Simple api wrapper of rule34.xxx for python with asynchronous support"
|
|
12
12
|
readme = "README.md"
|
|
13
|
-
requires-python = ">=3.
|
|
13
|
+
requires-python = ">=3.11"
|
|
14
14
|
classifiers = [
|
|
15
15
|
"Programming Language :: Python :: 3",
|
|
16
16
|
"License :: OSI Approved :: MIT License",
|
|
@@ -24,7 +24,16 @@ class File(BaseModel):
|
|
|
24
24
|
|
|
25
25
|
self.type = get_file_type(str(self.url))
|
|
26
26
|
|
|
27
|
-
async def download(self, path: Path | str = "./rule34_downloads", file_name: Path | str = None) -> Path:
|
|
27
|
+
async def download(self, path: Path | str = "./rule34_downloads", file_name: Path | str = None) -> Path | None:
|
|
28
|
+
"""
|
|
29
|
+
Download a file to given path with given name
|
|
30
|
+
|
|
31
|
+
:param path: Path where file will be saved
|
|
32
|
+
:param file_name: Custom file name
|
|
33
|
+
|
|
34
|
+
:return: Path to downloaded file or None if file was not found
|
|
35
|
+
"""
|
|
36
|
+
|
|
28
37
|
if isinstance(path, str):
|
|
29
38
|
path = Path(path)
|
|
30
39
|
if isinstance(file_name, str):
|
|
@@ -35,9 +44,11 @@ class File(BaseModel):
|
|
|
35
44
|
|
|
36
45
|
async with aiohttp.ClientSession() as session:
|
|
37
46
|
async with session.get(str(self.url)) as response:
|
|
38
|
-
if response.status != 200:
|
|
47
|
+
if response.status != 200 and response.status not in [404]:
|
|
39
48
|
raise ApiException(f"Api returned status code {response.status} with message"
|
|
40
49
|
f" {await response.text()}")
|
|
50
|
+
elif response.status == 404:
|
|
51
|
+
return None
|
|
41
52
|
|
|
42
53
|
original_file_name = Path(os.path.basename(str(self.url)))
|
|
43
54
|
file_name = original_file_name if file_name is None else file_name
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: simple_rule34
|
|
3
|
-
Version: 1.0.0.
|
|
3
|
+
Version: 1.0.0.4
|
|
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
|
|
@@ -8,7 +8,7 @@ Project-URL: Bug Tracker, https://github.com/SyperAlexKomp/simple-rule34-api/iss
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: aiofiles~=25.1.0
|
|
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-1.0.0.2 → simple_rule34-1.0.0.4}/src/simple_rule34.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|