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.
Files changed (28) hide show
  1. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/PKG-INFO +3 -2
  2. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/README.md +1 -1
  3. anilibria_api_client-0.1.7/anilibria_api_client/__init__.py +29 -0
  4. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/api_client.py +1 -0
  5. anilibria_api_client-0.1.7/anilibria_api_client/exceptions.py +7 -0
  6. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/helper.py +26 -19
  7. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/_helper.py +9 -1
  8. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/accounts.py +2 -1
  9. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/models.py +10 -1
  10. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/PKG-INFO +3 -2
  11. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/pyproject.toml +2 -1
  12. anilibria_api_client-0.1.6/anilibria_api_client/__init__.py +0 -5
  13. anilibria_api_client-0.1.6/anilibria_api_client/exceptions.py +0 -5
  14. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/LICENSE +0 -0
  15. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/base_api/api_class.py +0 -0
  16. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/__init__.py +0 -0
  17. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/_libria.py +0 -0
  18. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/ads.py +0 -0
  19. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/anime.py +0 -0
  20. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/app.py +0 -0
  21. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/media.py +0 -0
  22. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/methods/teams.py +0 -0
  23. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client/types.py +0 -0
  24. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/SOURCES.txt +0 -0
  25. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/dependency_links.txt +0 -0
  26. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/requires.txt +0 -0
  27. {anilibria_api_client-0.1.6 → anilibria_api_client-0.1.7}/anilibria_api_client.egg-info/top_level.txt +0 -0
  28. {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.6
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
  [![pypi](https://img.shields.io/badge/anilibria_api_client_on_PyPi-blue)](https://pypi.org/project/anilibria-api-client)
30
- ![version](https://img.shields.io/badge/Version-0.1.6-blue)
31
+ ![version](https://img.shields.io/badge/Version-0.1.7-blue)
31
32
  ![licence](https://img.shields.io/badge/License-MIT-green)
32
33
  ![python](https://img.shields.io/badge/Python-3.13%2B-blue)
33
34
 
@@ -1,7 +1,7 @@
1
1
  # Anilibria-Api-Client
2
2
 
3
3
  [![pypi](https://img.shields.io/badge/anilibria_api_client_on_PyPi-blue)](https://pypi.org/project/anilibria-api-client)
4
- ![version](https://img.shields.io/badge/Version-0.1.6-blue)
4
+ ![version](https://img.shields.io/badge/Version-0.1.7-blue)
5
5
  ![licence](https://img.shields.io/badge/License-MIT-green)
6
6
  ![python](https://img.shields.io/badge/Python-3.13%2B-blue)
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
+ )
@@ -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
@@ -0,0 +1,7 @@
1
+ class AnilibriaException(Exception):
2
+ """Общий класс для валидации ошибок"""
3
+ pass
4
+
5
+ class AnilibriaValidationException(AnilibriaException):
6
+ """Ошибка валидации на стороне Anilibria"""
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,10 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anilibria-api-client
3
- Version: 0.1.6
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
  [![pypi](https://img.shields.io/badge/anilibria_api_client_on_PyPi-blue)](https://pypi.org/project/anilibria-api-client)
30
- ![version](https://img.shields.io/badge/Version-0.1.6-blue)
31
+ ![version](https://img.shields.io/badge/Version-0.1.7-blue)
31
32
  ![licence](https://img.shields.io/badge/License-MIT-green)
32
33
  ![python](https://img.shields.io/badge/Python-3.13%2B-blue)
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.6"
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]
@@ -1,5 +0,0 @@
1
- from .api_client import *
2
- from .types import *
3
- from .models import *
4
- from .exceptions import *
5
- from .helper import *
@@ -1,5 +0,0 @@
1
- class AnilibriaException(Exception):
2
- pass
3
-
4
- class AnilibriaValidationException(AnilibriaException):
5
- pass