anilibria-api-client 0.1.6__tar.gz → 0.1.7__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.
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/PKG-INFO +3 -2
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/README.md +1 -1
- anilibria_api_client-0.1.7/anilibria_api_client/__init__.py +29 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/api_client.py +1 -0
- anilibria_api_client-0.1.7/anilibria_api_client/exceptions.py +7 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/helper.py +26 -19
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/_helper.py +9 -1
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/accounts.py +2 -1
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/models.py +10 -1
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/PKG-INFO +3 -2
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/pyproject.toml +2 -1
- anilibria_api_client-0.1.6/anilibria_api_client/__init__.py +0 -5
- anilibria_api_client-0.1.6/anilibria_api_client/exceptions.py +0 -5
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/LICENSE +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/base_api/api_class.py +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/__init__.py +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/_libria.py +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/ads.py +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/anime.py +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/app.py +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/media.py +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/teams.py +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/types.py +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/SOURCES.txt +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/dependency_links.txt +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/requires.txt +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/top_level.txt +0 -0
- {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/setup.cfg +0 -0
@@ -1,10 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: anilibria-api-client
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.7
|
4
4
|
Summary: Python async API wrapper for AniLibria Swagger
|
5
5
|
Author-email: semen-bol <syoma.bolotov@bk.ru>
|
6
6
|
License: MIT
|
7
7
|
Project-URL: Homepage, https://github.com/semen-bol/Anilibria-Api-Client
|
8
|
+
Project-URL: Docs, https://anilibria-api-client.readthedocs.io/latest/
|
8
9
|
Project-URL: Issues, https://github.com/semen-bol/Anilibria-Api-Client/issues
|
9
10
|
Requires-Python: >=3.13
|
10
11
|
Description-Content-Type: text/markdown
|
@@ -27,7 +28,7 @@ Dynamic: license-file
|
|
27
28
|
# Anilibria-Api-Client
|
28
29
|
|
29
30
|
[](https://pypi.org/project/anilibria-api-client)
|
30
|
-

|
31
32
|

|
32
33
|

|
33
34
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Anilibria-Api-Client
|
2
2
|
|
3
3
|
[](https://pypi.org/project/anilibria-api-client)
|
4
|
-

|
5
5
|

|
6
6
|

|
7
7
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
from .api_client import AsyncAnilibriaAPI
|
2
|
+
|
3
|
+
from .types import (
|
4
|
+
CollectionType,
|
5
|
+
ContentType,
|
6
|
+
AgeRating,
|
7
|
+
Seasons,
|
8
|
+
SortType,
|
9
|
+
PublishStatusesType,
|
10
|
+
ProductionStatusesType
|
11
|
+
)
|
12
|
+
|
13
|
+
from .models import (
|
14
|
+
TimeCode,
|
15
|
+
Release,
|
16
|
+
ReleaseCollection
|
17
|
+
)
|
18
|
+
|
19
|
+
from .exceptions import (
|
20
|
+
AnilibriaException,
|
21
|
+
AnilibriaValidationException
|
22
|
+
)
|
23
|
+
|
24
|
+
from .helper import (
|
25
|
+
async_download,
|
26
|
+
async_ffmpeg_download,
|
27
|
+
auth,
|
28
|
+
download_torrent_file
|
29
|
+
)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import m3u8_To_MP4
|
2
|
-
import os
|
2
|
+
import os # Path / Makedir
|
3
3
|
import aiofiles
|
4
4
|
|
5
5
|
from .api_client import AsyncAnilibriaAPI
|
@@ -7,14 +7,30 @@ from .exceptions import AnilibriaException
|
|
7
7
|
|
8
8
|
from ffmpeg.asyncio import FFmpeg
|
9
9
|
|
10
|
+
|
11
|
+
async def auth(api: AsyncAnilibriaAPI, login: str, password: str) -> AsyncAnilibriaAPI:
|
12
|
+
"""
|
13
|
+
Используется для простой авторизации без использования методов одной строчкой
|
14
|
+
|
15
|
+
:param api: AsyncAnilibriaAPI
|
16
|
+
:param login: Логин от ЛК Anilibria
|
17
|
+
:param password: Пароль от ЛК Anilibria
|
18
|
+
:return: AsyncAnilibriaAPI
|
19
|
+
"""
|
20
|
+
try:
|
21
|
+
res = await api.accounts.users_auth_login(login=login, password=password)
|
22
|
+
|
23
|
+
return AsyncAnilibriaAPI(authorization=f"Bearer {res.get("token")}")
|
24
|
+
except AnilibriaException as e:
|
25
|
+
raise AnilibriaException("Auth error!")
|
26
|
+
|
10
27
|
async def async_download(url: str, output_path: str = None, filename: str = "output.mp4"):
|
11
28
|
"""
|
12
29
|
Позволяет скачивать серию через URL (https://cache-rfn.libria.fun/videos/media/)
|
13
30
|
ffmpeg required
|
14
31
|
|
15
|
-
|
16
|
-
|
17
|
-
output_path: Полный путь к выходному файлу (включая имя файла и расширение .mp4)
|
32
|
+
:param url: Ссылка на m3u8 плейлист
|
33
|
+
:param output_path: Полный путь к выходному файлу (включая имя файла и расширение .mp4)
|
18
34
|
"""
|
19
35
|
if output_path is None:
|
20
36
|
mp4_file_dir = os.getcwd()
|
@@ -41,9 +57,9 @@ async def async_ffmpeg_download(url: str, output_path: str) -> bool:
|
|
41
57
|
|
42
58
|
Может быть медленным, используйте хороший интернет
|
43
59
|
|
44
|
-
|
45
|
-
|
46
|
-
|
60
|
+
:param url: Ссылка
|
61
|
+
:param output_path: Путь для сохранения MP4 файла
|
62
|
+
:return: bool
|
47
63
|
"""
|
48
64
|
try:
|
49
65
|
ffmpeg = (
|
@@ -62,27 +78,18 @@ async def async_ffmpeg_download(url: str, output_path: str) -> bool:
|
|
62
78
|
return True
|
63
79
|
|
64
80
|
except KeyError:
|
65
|
-
|
81
|
+
return "Запрашиваемое видео недоступно."
|
66
82
|
except ValueError:
|
67
83
|
return "Неверная ссылка."
|
68
84
|
except Exception as e:
|
69
85
|
return "Произошла непредвиденная ошибка при загрузке видео: " + str(e)
|
70
|
-
|
71
|
-
async def auth(api: AsyncAnilibriaAPI, login: str, password: str):
|
72
|
-
try:
|
73
|
-
res = await api.accounts.users_auth_login(login=login, password=password)
|
74
|
-
|
75
|
-
return AsyncAnilibriaAPI(authorization=f"Bearer {res.get("token")}")
|
76
|
-
except AnilibriaException as e:
|
77
|
-
raise AnilibriaException("Auth error!")
|
78
86
|
|
79
87
|
async def download_torrent_file(torrent_bytes: bytes, filename: str):
|
80
88
|
"""
|
81
89
|
Асинхронно сохраняет .torrent файл
|
82
90
|
|
83
|
-
|
84
|
-
|
85
|
-
filename: имя файла
|
91
|
+
:param torrent_bytes: бинарные данные torrent-файла
|
92
|
+
:param filename: имя файла
|
86
93
|
"""
|
87
94
|
if not filename.endswith('.torrent'):
|
88
95
|
filename += '.torrent'
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/_helper.py
RENAMED
@@ -1,7 +1,15 @@
|
|
1
1
|
from typing import Dict, Any
|
2
|
-
from ..types import
|
2
|
+
from ..types import (
|
3
|
+
AgeRating,
|
4
|
+
SortType,
|
5
|
+
ContentType,
|
6
|
+
Seasons,
|
7
|
+
PublishStatusesType,
|
8
|
+
ProductionStatusesType
|
9
|
+
)
|
3
10
|
from ..models import ReleaseCollection, Release
|
4
11
|
|
12
|
+
|
5
13
|
async def validate_filters(params: Release) -> Dict[str, Any]:
|
6
14
|
"""
|
7
15
|
Валидация параметров фильтров в формате f["название_переменной"]
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/accounts.py
RENAMED
@@ -1,7 +1,8 @@
|
|
1
1
|
from ._libria import BaseMethod
|
2
2
|
from ..models import TimeCode, ReleaseCollection
|
3
3
|
from ._helper import validate_collection, validated_json_collection
|
4
|
-
from typing import Optional, List
|
4
|
+
from typing import Optional, List
|
5
|
+
|
5
6
|
|
6
7
|
class AccountsMethod(BaseMethod):
|
7
8
|
async def otp_get(
|
@@ -1,6 +1,15 @@
|
|
1
1
|
from pydantic import BaseModel
|
2
2
|
from typing import List
|
3
|
-
from .types import
|
3
|
+
from .types import (
|
4
|
+
ContentType,
|
5
|
+
Seasons,
|
6
|
+
SortType,
|
7
|
+
AgeRating,
|
8
|
+
PublishStatusesType,
|
9
|
+
ProductionStatusesType,
|
10
|
+
CollectionType
|
11
|
+
)
|
12
|
+
|
4
13
|
|
5
14
|
class TimeCode(BaseModel):
|
6
15
|
"""
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/PKG-INFO
RENAMED
@@ -1,10 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: anilibria-api-client
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.7
|
4
4
|
Summary: Python async API wrapper for AniLibria Swagger
|
5
5
|
Author-email: semen-bol <syoma.bolotov@bk.ru>
|
6
6
|
License: MIT
|
7
7
|
Project-URL: Homepage, https://github.com/semen-bol/Anilibria-Api-Client
|
8
|
+
Project-URL: Docs, https://anilibria-api-client.readthedocs.io/latest/
|
8
9
|
Project-URL: Issues, https://github.com/semen-bol/Anilibria-Api-Client/issues
|
9
10
|
Requires-Python: >=3.13
|
10
11
|
Description-Content-Type: text/markdown
|
@@ -27,7 +28,7 @@ Dynamic: license-file
|
|
27
28
|
# Anilibria-Api-Client
|
28
29
|
|
29
30
|
[](https://pypi.org/project/anilibria-api-client)
|
30
|
-

|
31
32
|

|
32
33
|

|
33
34
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "anilibria-api-client"
|
7
|
-
version = "0.1.
|
7
|
+
version = "0.1.7"
|
8
8
|
description = "Python async API wrapper for AniLibria Swagger"
|
9
9
|
authors = [
|
10
10
|
{name = "semen-bol", email = "syoma.bolotov@bk.ru"}
|
@@ -22,6 +22,7 @@ dependencies = [
|
|
22
22
|
|
23
23
|
[project.urls]
|
24
24
|
Homepage = "https://github.com/semen-bol/Anilibria-Api-Client"
|
25
|
+
Docs = "https://anilibria-api-client.readthedocs.io/latest/"
|
25
26
|
Issues = "https://github.com/semen-bol/Anilibria-Api-Client/issues"
|
26
27
|
|
27
28
|
[tool.setuptools.packages.find]
|
File without changes
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/base_api/api_class.py
RENAMED
File without changes
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/__init__.py
RENAMED
File without changes
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/_libria.py
RENAMED
File without changes
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/ads.py
RENAMED
File without changes
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/anime.py
RENAMED
File without changes
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/app.py
RENAMED
File without changes
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/media.py
RENAMED
File without changes
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/teams.py
RENAMED
File without changes
|
File without changes
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/requires.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|