anilibria-api-client 0.1.5__py3-none-any.whl → 0.1.7__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.
@@ -1,5 +1,29 @@
1
- from .api_client import *
2
- from .types import *
3
- from .models import *
4
- from .exceptions import *
5
- from .helper import *
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
+ )
@@ -10,6 +10,7 @@ from .methods import (
10
10
  TeamsMethod
11
11
  )
12
12
 
13
+
13
14
  class AsyncAnilibriaAPI(AsyncBaseAPI):
14
15
  """
15
16
  Асинхронный клиент для работы с AnilibriaAPI
@@ -1,5 +1,7 @@
1
1
  class AnilibriaException(Exception):
2
+ """Общий класс для валидации ошибок"""
2
3
  pass
3
4
 
4
5
  class AnilibriaValidationException(AnilibriaException):
6
+ """Ошибка валидации на стороне Anilibria"""
5
7
  pass
@@ -1,5 +1,5 @@
1
1
  import m3u8_To_MP4
2
- import os # only for path / make dir
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
- Args:
16
- url: Ссылка на m3u8 плейлист
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
- Args:
45
- url: Ссылка
46
- output_path: Путь для сохранения MP4 файла
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
- return "Запрашиваемое видео недоступно."
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
- Args:
84
- torrent_bytes: бинарные данные torrent-файла
85
- filename: имя файла
91
+ :param torrent_bytes: бинарные данные torrent-файла
92
+ :param filename: имя файла
86
93
  """
87
94
  if not filename.endswith('.torrent'):
88
95
  filename += '.torrent'
@@ -1,7 +1,15 @@
1
1
  from typing import Dict, Any
2
- from ..types import AgeRating, SortType, ContentType, Seasons, PublishStatusesType, ProductionStatusesType
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["название_переменной"]
@@ -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, Dict
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
  """
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anilibria-api-client
3
- Version: 0.1.5
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
- Requires-Python: >=3.11
10
+ Requires-Python: >=3.13
10
11
  Description-Content-Type: text/markdown
11
12
  License-File: LICENSE
12
13
  Requires-Dist: aiohttp==3.12.15
@@ -14,12 +15,20 @@ Requires-Dist: aiofiles==24.1.0
14
15
  Requires-Dist: pydantic==2.11.7
15
16
  Requires-Dist: m3u8-To-MP4==0.1.11
16
17
  Requires-Dist: ffmpeg-python==0.2.0
18
+ Provides-Extra: docs
19
+ Requires-Dist: sphinx>=7.0.0; extra == "docs"
20
+ Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "docs"
21
+ Requires-Dist: sphinx-autodoc-typehints>=1.0.0; extra == "docs"
22
+ Requires-Dist: sphinx_design>=0.6.1; extra == "docs"
23
+ Requires-Dist: furo>=2025.7.19; extra == "docs"
24
+ Requires-Dist: sphinx-hoverxref>=1.3.0; extra == "docs"
25
+ Requires-Dist: readthedocs-sphinx-search>=0.1.2; extra == "docs"
17
26
  Dynamic: license-file
18
27
 
19
28
  # Anilibria-Api-Client
20
29
 
21
30
  [![pypi](https://img.shields.io/badge/anilibria_api_client_on_PyPi-blue)](https://pypi.org/project/anilibria-api-client)
22
- ![version](https://img.shields.io/badge/Version-0.1.5-blue)
31
+ ![version](https://img.shields.io/badge/Version-0.1.7-blue)
23
32
  ![licence](https://img.shields.io/badge/License-MIT-green)
24
33
  ![python](https://img.shields.io/badge/Python-3.13%2B-blue)
25
34
 
@@ -51,7 +60,7 @@ async def main():
51
60
  ```
52
61
 
53
62
  ## Documentation 📃
54
- Docs..
63
+ [Docs](https://anilibria-api-client.readthedocs.io/latest/)
55
64
  ## Issues/Contributing
56
65
  ### Issues
57
66
  Report for any issues [here](https://github.com/semen-bol/Anilibria-Api-Client/issues)
@@ -0,0 +1,21 @@
1
+ anilibria_api_client/__init__.py,sha256=QK96j3GMPQTEDfWSeahdWFPGTZN6gPP4PkwlnutxbzI,492
2
+ anilibria_api_client/api_client.py,sha256=aVZuqNrtddLrH3QhrsU1tlkWG-ol-NZjDHzdekoX-f0,2057
3
+ anilibria_api_client/exceptions.py,sha256=rdvauYgc2gfBu7xqe4bwA6TEkE8G3DRppIUUZ1ZAcYA,260
4
+ anilibria_api_client/helper.py,sha256=Ur5RdlDC1d61_YFC_pUWcFJyyLCIi1p2w8Y4VglAdmw,3611
5
+ anilibria_api_client/models.py,sha256=01hAZ5UAnBbKAeBnOywu2XfLO2YnpLle-uOOwRlWnuo,1752
6
+ anilibria_api_client/types.py,sha256=1O3tucimHpS2Xo5vNeKrTrdQMlh8JEwQ0ap3ffa0nck,1399
7
+ anilibria_api_client/base_api/api_class.py,sha256=g3tcpeZyappRG99L-0uWvcFO74Eqo5ubwvbhI9UGxQw,11486
8
+ anilibria_api_client/methods/__init__.py,sha256=zZ2EpsQUYnke7AedgMe6vKYaWk9BSocO0M423UPqsyI,188
9
+ anilibria_api_client/methods/_helper.py,sha256=3kU6Omg4auHmuEUxY6KuSF-BOnbmLJyMjEiElUBJu5Y,10003
10
+ anilibria_api_client/methods/_libria.py,sha256=R0l59PRMkfvAMF_aET-9rvjcTLdwueDdxusiTUxSqX0,206
11
+ anilibria_api_client/methods/accounts.py,sha256=TdwVC0lHpWtAx3OtEnTxn_pL3CdS4jyXGFROPD_BYKI,13579
12
+ anilibria_api_client/methods/ads.py,sha256=6h8vFwLre6_5k26GTcS6eiUL-jx0uRqrb1zm9m2Pnz0,717
13
+ anilibria_api_client/methods/anime.py,sha256=Cw-dvBypJ9YV3QOTXWeBsAe1_R4Z1uQdxb79xCyq7-M,23423
14
+ anilibria_api_client/methods/app.py,sha256=yw7L4Z0XTxIBSWJK_kZSRSK0a_ojNQdbGmzu_m4AIt4,1063
15
+ anilibria_api_client/methods/media.py,sha256=9I20jNpDTrUDTY6kHf_SNuewZ7p9ptMhbZ0_9IDD8A0,1431
16
+ anilibria_api_client/methods/teams.py,sha256=dQJiB7LdwyrDZ88zh0bA2IplK2--g7eQszKDHOPth6c,1792
17
+ anilibria_api_client-0.1.7.dist-info/licenses/LICENSE,sha256=gr_OTPhIQY61xF6N31e1tkelwhltQiSRA4t9HcdU11g,1091
18
+ anilibria_api_client-0.1.7.dist-info/METADATA,sha256=6RESp5pxTtjqe3TUo6VfYEMyCzi58vZ6P7devId6BqI,2889
19
+ anilibria_api_client-0.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
+ anilibria_api_client-0.1.7.dist-info/top_level.txt,sha256=0KrvVOhSbGINTxZwsEcOZQ1hWnjRTpVp6LjDv99rhYM,21
21
+ anilibria_api_client-0.1.7.dist-info/RECORD,,
@@ -1,21 +0,0 @@
1
- anilibria_api_client/__init__.py,sha256=LlU9iPqenJeWGS2vyexP-VINZCZ5IqNnoZ3Mqtin8cw,120
2
- anilibria_api_client/api_client.py,sha256=uZDd8NtX02jB56cOnux3NuylT4elwa_ZIJNTsY7PlwE,2055
3
- anilibria_api_client/exceptions.py,sha256=j0M7ln6XK550ncl1i1IW4Ui2bCwNQA9N1in1wNBqr2g,115
4
- anilibria_api_client/helper.py,sha256=1x8gYmktzywq8d-kzoQZuUyEMIA6wyOuUlObkOwkUqQ,3244
5
- anilibria_api_client/models.py,sha256=gGV5jVKxDUk84WWtiL5Mu3u-FeLhqpzMN2TXMFP29Xw,1603
6
- anilibria_api_client/types.py,sha256=1O3tucimHpS2Xo5vNeKrTrdQMlh8JEwQ0ap3ffa0nck,1399
7
- anilibria_api_client/base_api/api_class.py,sha256=g3tcpeZyappRG99L-0uWvcFO74Eqo5ubwvbhI9UGxQw,11486
8
- anilibria_api_client/methods/__init__.py,sha256=zZ2EpsQUYnke7AedgMe6vKYaWk9BSocO0M423UPqsyI,188
9
- anilibria_api_client/methods/_helper.py,sha256=2eQIaitEJ_DaSqxwPug0-zW7cM2he7-6KHtrDxb0dY8,9961
10
- anilibria_api_client/methods/_libria.py,sha256=R0l59PRMkfvAMF_aET-9rvjcTLdwueDdxusiTUxSqX0,206
11
- anilibria_api_client/methods/accounts.py,sha256=H3lbSrTmISyZwpREnrTlD8RhepYnIa1sKLiQMQEHEfw,13583
12
- anilibria_api_client/methods/ads.py,sha256=6h8vFwLre6_5k26GTcS6eiUL-jx0uRqrb1zm9m2Pnz0,717
13
- anilibria_api_client/methods/anime.py,sha256=Cw-dvBypJ9YV3QOTXWeBsAe1_R4Z1uQdxb79xCyq7-M,23423
14
- anilibria_api_client/methods/app.py,sha256=yw7L4Z0XTxIBSWJK_kZSRSK0a_ojNQdbGmzu_m4AIt4,1063
15
- anilibria_api_client/methods/media.py,sha256=9I20jNpDTrUDTY6kHf_SNuewZ7p9ptMhbZ0_9IDD8A0,1431
16
- anilibria_api_client/methods/teams.py,sha256=dQJiB7LdwyrDZ88zh0bA2IplK2--g7eQszKDHOPth6c,1792
17
- anilibria_api_client-0.1.5.dist-info/licenses/LICENSE,sha256=gr_OTPhIQY61xF6N31e1tkelwhltQiSRA4t9HcdU11g,1091
18
- anilibria_api_client-0.1.5.dist-info/METADATA,sha256=hA_red6pjleJr2UbwjeTdH3NgZJ-ebAffGVk3A18aKs,2347
19
- anilibria_api_client-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- anilibria_api_client-0.1.5.dist-info/top_level.txt,sha256=0KrvVOhSbGINTxZwsEcOZQ1hWnjRTpVp6LjDv99rhYM,21
21
- anilibria_api_client-0.1.5.dist-info/RECORD,,