anilibria-api-client 0.1.7__py3-none-any.whl → 0.1.8__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.
- anilibria_api_client/__init__.py +28 -28
- anilibria_api_client/api_client.py +58 -58
- anilibria_api_client/base_api/api_class.py +283 -283
- anilibria_api_client/exceptions.py +6 -6
- anilibria_api_client/helper.py +100 -100
- anilibria_api_client/methods/__init__.py +5 -5
- anilibria_api_client/methods/_helper.py +225 -225
- anilibria_api_client/methods/_libria.py +9 -9
- anilibria_api_client/methods/accounts.py +348 -348
- anilibria_api_client/methods/ads.py +22 -22
- anilibria_api_client/methods/anime.py +669 -669
- anilibria_api_client/methods/app.py +33 -33
- anilibria_api_client/methods/media.py +44 -44
- anilibria_api_client/methods/teams.py +60 -60
- anilibria_api_client/models.py +63 -63
- anilibria_api_client/types.py +55 -55
- {anilibria_api_client-0.1.7.dist-info → anilibria_api_client-0.1.8.dist-info}/METADATA +83 -71
- anilibria_api_client-0.1.8.dist-info/RECORD +21 -0
- {anilibria_api_client-0.1.7.dist-info → anilibria_api_client-0.1.8.dist-info}/licenses/LICENSE +21 -21
- anilibria_api_client-0.1.7.dist-info/RECORD +0 -21
- {anilibria_api_client-0.1.7.dist-info → anilibria_api_client-0.1.8.dist-info}/WHEEL +0 -0
- {anilibria_api_client-0.1.7.dist-info → anilibria_api_client-0.1.8.dist-info}/top_level.txt +0 -0
anilibria_api_client/__init__.py
CHANGED
@@ -1,29 +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
|
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
29
|
)
|
@@ -1,59 +1,59 @@
|
|
1
|
-
from .base_api.api_class import AsyncBaseAPI
|
2
|
-
from typing import Optional, Dict, Any, Optional, Union
|
3
|
-
|
4
|
-
from .methods import (
|
5
|
-
AccountsMethod,
|
6
|
-
AdsMethod,
|
7
|
-
AnimeMethod,
|
8
|
-
AppMethod,
|
9
|
-
MediaMethod,
|
10
|
-
TeamsMethod
|
11
|
-
)
|
12
|
-
|
13
|
-
|
14
|
-
class AsyncAnilibriaAPI(AsyncBaseAPI):
|
15
|
-
"""
|
16
|
-
Асинхронный клиент для работы с AnilibriaAPI
|
17
|
-
"""
|
18
|
-
def __init__(
|
19
|
-
self,
|
20
|
-
base_url: str = "https://anilibria.top/api/v1",
|
21
|
-
authorization: str = "Bearer"
|
22
|
-
):
|
23
|
-
headers = {
|
24
|
-
"Content-Type": "application/json",
|
25
|
-
"Authorization": authorization
|
26
|
-
}
|
27
|
-
|
28
|
-
super().__init__(base_url=base_url, headers=headers)
|
29
|
-
|
30
|
-
self.accounts = AccountsMethod(api=self)
|
31
|
-
self.ads = AdsMethod(api=self)
|
32
|
-
self.anime = AnimeMethod(api=self)
|
33
|
-
self.app = AppMethod(api=self)
|
34
|
-
self.media = MediaMethod(api=self)
|
35
|
-
self.teams = TeamsMethod(api=self)
|
36
|
-
|
37
|
-
async def execute(
|
38
|
-
self,
|
39
|
-
endpoint: str,
|
40
|
-
method: str = 'GET',
|
41
|
-
data: Optional[Union[Dict[str, Any], str, bytes]] = None,
|
42
|
-
json_data: Optional[Dict[str, Any]] = None,
|
43
|
-
headers: Optional[Dict[str, str]] = None,
|
44
|
-
**kwargs
|
45
|
-
) -> Union[Dict[str, Any], str, bytes]:
|
46
|
-
"""
|
47
|
-
Создание своего уникального запроса
|
48
|
-
|
49
|
-
:param method: Метод используемый для запроса, например GET (обязательно)
|
50
|
-
:param endpoint: Конечная точка API (обязательно)
|
51
|
-
:param data: Тело запроса
|
52
|
-
:param json_data: JSON тело запроса
|
53
|
-
:param headers: Дополнительные заголовки
|
54
|
-
:param kwargs: Дополнительные аргументы для aiohttp
|
55
|
-
:return: Ответ от API
|
56
|
-
"""
|
57
|
-
|
58
|
-
return await self._request(method, endpoint, data=data, json_data=json_data, headers=headers, **kwargs)
|
1
|
+
from .base_api.api_class import AsyncBaseAPI
|
2
|
+
from typing import Optional, Dict, Any, Optional, Union
|
3
|
+
|
4
|
+
from .methods import (
|
5
|
+
AccountsMethod,
|
6
|
+
AdsMethod,
|
7
|
+
AnimeMethod,
|
8
|
+
AppMethod,
|
9
|
+
MediaMethod,
|
10
|
+
TeamsMethod
|
11
|
+
)
|
12
|
+
|
13
|
+
|
14
|
+
class AsyncAnilibriaAPI(AsyncBaseAPI):
|
15
|
+
"""
|
16
|
+
Асинхронный клиент для работы с AnilibriaAPI
|
17
|
+
"""
|
18
|
+
def __init__(
|
19
|
+
self,
|
20
|
+
base_url: str = "https://anilibria.top/api/v1",
|
21
|
+
authorization: str = "Bearer"
|
22
|
+
):
|
23
|
+
headers = {
|
24
|
+
"Content-Type": "application/json",
|
25
|
+
"Authorization": authorization
|
26
|
+
}
|
27
|
+
|
28
|
+
super().__init__(base_url=base_url, headers=headers)
|
29
|
+
|
30
|
+
self.accounts = AccountsMethod(api=self)
|
31
|
+
self.ads = AdsMethod(api=self)
|
32
|
+
self.anime = AnimeMethod(api=self)
|
33
|
+
self.app = AppMethod(api=self)
|
34
|
+
self.media = MediaMethod(api=self)
|
35
|
+
self.teams = TeamsMethod(api=self)
|
36
|
+
|
37
|
+
async def execute(
|
38
|
+
self,
|
39
|
+
endpoint: str,
|
40
|
+
method: str = 'GET',
|
41
|
+
data: Optional[Union[Dict[str, Any], str, bytes]] = None,
|
42
|
+
json_data: Optional[Dict[str, Any]] = None,
|
43
|
+
headers: Optional[Dict[str, str]] = None,
|
44
|
+
**kwargs
|
45
|
+
) -> Union[Dict[str, Any], str, bytes]:
|
46
|
+
"""
|
47
|
+
Создание своего уникального запроса
|
48
|
+
|
49
|
+
:param method: Метод используемый для запроса, например GET (обязательно)
|
50
|
+
:param endpoint: Конечная точка API (обязательно)
|
51
|
+
:param data: Тело запроса
|
52
|
+
:param json_data: JSON тело запроса
|
53
|
+
:param headers: Дополнительные заголовки
|
54
|
+
:param kwargs: Дополнительные аргументы для aiohttp
|
55
|
+
:return: Ответ от API
|
56
|
+
"""
|
57
|
+
|
58
|
+
return await self._request(method, endpoint, data=data, json_data=json_data, headers=headers, **kwargs)
|
59
59
|
|