anilibria-api-client 0.1.6__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.
@@ -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
+ )
@@ -1,58 +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
- class AsyncAnilibriaAPI(AsyncBaseAPI):
14
- """
15
- Асинхронный клиент для работы с AnilibriaAPI
16
- """
17
- def __init__(
18
- self,
19
- base_url: str = "https://anilibria.top/api/v1",
20
- authorization: str = "Bearer"
21
- ):
22
- headers = {
23
- "Content-Type": "application/json",
24
- "Authorization": authorization
25
- }
26
-
27
- super().__init__(base_url=base_url, headers=headers)
28
-
29
- self.accounts = AccountsMethod(api=self)
30
- self.ads = AdsMethod(api=self)
31
- self.anime = AnimeMethod(api=self)
32
- self.app = AppMethod(api=self)
33
- self.media = MediaMethod(api=self)
34
- self.teams = TeamsMethod(api=self)
35
-
36
- async def execute(
37
- self,
38
- endpoint: str,
39
- method: str = 'GET',
40
- data: Optional[Union[Dict[str, Any], str, bytes]] = None,
41
- json_data: Optional[Dict[str, Any]] = None,
42
- headers: Optional[Dict[str, str]] = None,
43
- **kwargs
44
- ) -> Union[Dict[str, Any], str, bytes]:
45
- """
46
- Создание своего уникального запроса
47
-
48
- :param method: Метод используемый для запроса, например GET (обязательно)
49
- :param endpoint: Конечная точка API (обязательно)
50
- :param data: Тело запроса
51
- :param json_data: JSON тело запроса
52
- :param headers: Дополнительные заголовки
53
- :param kwargs: Дополнительные аргументы для aiohttp
54
- :return: Ответ от API
55
- """
56
-
57
- 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)
58
59