arizona-forum-api-async 1.2__tar.gz → 1.3__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.
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/PKG-INFO +1 -1
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_api_async.egg-info/PKG-INFO +1 -1
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/api.py +38 -11
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/member_object.py +3 -2
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/thread_object.py +6 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/setup.py +1 -1
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/MANIFEST.in +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/README.md +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_api_async.egg-info/SOURCES.txt +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_api_async.egg-info/dependency_links.txt +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_api_async.egg-info/requires.txt +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_api_async.egg-info/top_level.txt +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/__init__.py +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/__pycache__/__init__.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/__pycache__/api.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/__pycache__/consts.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/__pycache__/exceptions.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/bypass_antibot/__init__.py +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/bypass_antibot/__pycache__/__init__.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/bypass_antibot/__pycache__/script.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/bypass_antibot/script.py +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/consts.py +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/exceptions.py +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/__init__.py +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/__pycache__/__init__.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/__pycache__/category_object.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/__pycache__/member_object.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/__pycache__/other.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/__pycache__/post_object.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/__pycache__/thread_object.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/category_object.py +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/other.py +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/post_object.py +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/pyproject.toml +0 -0
- {arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: arizona-forum-api-async
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.3
|
4
4
|
Summary: Асинхронная Python библиотека для взаимодействия с форумом Arizona RP (forum.arizona-rp.com) без необходимости получения API ключа.
|
5
5
|
Home-page: https://github.com/fakelag28/Arizona-Forum-API-Async
|
6
6
|
Author: fakelag28
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: arizona-forum-api-async
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.3
|
4
4
|
Summary: Асинхронная Python библиотека для взаимодействия с форумом Arizona RP (forum.arizona-rp.com) без необходимости получения API ключа.
|
5
5
|
Home-page: https://github.com/fakelag28/Arizona-Forum-API-Async
|
6
6
|
Author: fakelag28
|
@@ -101,7 +101,7 @@ class ArizonaAPI:
|
|
101
101
|
raise Exception(f"Не удалось получить информацию для пользователя с ID {user_id}")
|
102
102
|
|
103
103
|
return CurrentMember(self, user_id, member_info.username, member_info.user_title,
|
104
|
-
member_info.avatar, member_info.roles, member_info.messages_count,
|
104
|
+
member_info.avatar, member_info.roles, member_info.activity, member_info.messages_count,
|
105
105
|
member_info.reactions_count, member_info.trophies_count, member_info.username_color)
|
106
106
|
except aiohttp.ClientError as e:
|
107
107
|
print(f"Ошибка сети при получении данных текущего пользователя: {e}")
|
@@ -149,7 +149,7 @@ class ArizonaAPI:
|
|
149
149
|
try:
|
150
150
|
async with self._session.get(url, params=params) as response:
|
151
151
|
if response.status == 403:
|
152
|
-
return Member(self, user_id, None, None, None, [], 0, 0, 0, '#fff')
|
152
|
+
return Member(self, user_id, None, None, None, None, [], 0, 0, 0, '#fff')
|
153
153
|
response.raise_for_status()
|
154
154
|
data = await response.json()
|
155
155
|
|
@@ -160,6 +160,8 @@ class ArizonaAPI:
|
|
160
160
|
soup = BeautifulSoup(html_content, 'lxml')
|
161
161
|
username = unescape(data['html']['title'])
|
162
162
|
|
163
|
+
activity = soup.find('dd', {'dir': 'auto'}).get_text(strip=False).strip('\n')
|
164
|
+
|
163
165
|
username_class = soup.find('span', class_='username')
|
164
166
|
username_color = '#fff'
|
165
167
|
if username_class:
|
@@ -207,11 +209,11 @@ class ArizonaAPI:
|
|
207
209
|
if trophy_tag: trophies_count = int(trophy_tag.text.strip().replace(',', ''))
|
208
210
|
except (AttributeError, ValueError): pass
|
209
211
|
|
210
|
-
return Member(self, user_id, username, user_title, avatar, roles, messages_count, reactions_count, trophies_count, username_color)
|
212
|
+
return Member(self, user_id, username, user_title, avatar, roles, activity, messages_count, reactions_count, trophies_count, username_color)
|
211
213
|
|
212
214
|
except aiohttp.ClientResponseError as e:
|
213
215
|
if e.status == 403:
|
214
|
-
return Member(self, user_id, None, None, None, [], 0, 0, 0, '#fff')
|
216
|
+
return Member(self, user_id, None, None, None, None, [], 0, 0, 0, '#fff')
|
215
217
|
print(f"Ошибка сети при получении пользователя {user_id}: {e}")
|
216
218
|
return None
|
217
219
|
except aiohttp.ClientError as e:
|
@@ -259,7 +261,7 @@ class ArizonaAPI:
|
|
259
261
|
except Exception as e:
|
260
262
|
print(f"Ошибка получения создателя ({creator_id}) для темы {thread_id}: {e}")
|
261
263
|
if not creator:
|
262
|
-
creator = Member(self, creator_id, creator_tag.text, None, None, None, None, None, None, None)
|
264
|
+
creator = Member(self, creator_id, creator_tag.text, None, None, None, None, None, None, None, None)
|
263
265
|
else:
|
264
266
|
print(f"Не удалось найти информацию о создателе для темы {thread_id}")
|
265
267
|
return None
|
@@ -277,7 +279,7 @@ class ArizonaAPI:
|
|
277
279
|
prefix_tag = content_h1_soup.find('span', {'class': 'label'})
|
278
280
|
if prefix_tag:
|
279
281
|
prefix = prefix_tag.text
|
280
|
-
title = content_h1_soup.text.strip(prefix).strip()
|
282
|
+
title = content_h1_soup.text.strip().replace(prefix, "").strip()
|
281
283
|
else:
|
282
284
|
prefix = ""
|
283
285
|
title = content_h1_soup.text.strip()
|
@@ -327,9 +329,9 @@ class ArizonaAPI:
|
|
327
329
|
try:
|
328
330
|
creator = await self.get_member(creator_id)
|
329
331
|
except Exception as e:
|
330
|
-
creator = Member(self, creator_id, None, None, None, None, None, None, None, None)
|
332
|
+
creator = Member(self, creator_id, None, None, None, None, None, None, None, None, None)
|
331
333
|
if not creator:
|
332
|
-
creator = Member(self, creator_id, creator_info_tag.text, None, None, None, None, None, None, None)
|
334
|
+
creator = Member(self, creator_id, creator_info_tag.text, None, None, None, None, None, None, None, None)
|
333
335
|
else:
|
334
336
|
return None
|
335
337
|
|
@@ -389,7 +391,7 @@ class ArizonaAPI:
|
|
389
391
|
try:
|
390
392
|
creator = await self.get_member(creator_id)
|
391
393
|
except Exception as e:
|
392
|
-
creator = Member(self, creator_id, None, None, None, [], 0, 0, 0, '#fff')
|
394
|
+
creator = Member(self, creator_id, None, None, None, None, [], 0, 0, 0, '#fff')
|
393
395
|
if not creator:
|
394
396
|
return None
|
395
397
|
else:
|
@@ -479,7 +481,7 @@ class ArizonaAPI:
|
|
479
481
|
try:
|
480
482
|
last_register_member = await self.get_member(last_user_id)
|
481
483
|
except Exception as e:
|
482
|
-
last_register_member = Member(self, last_user_id, None, None, None, [], 0, 0, 0, '#fff')
|
484
|
+
last_register_member = Member(self, last_user_id, None, None, None, None, [], 0, 0, 0, '#fff')
|
483
485
|
except (AttributeError, ValueError, Exception) as e:
|
484
486
|
pass
|
485
487
|
|
@@ -774,7 +776,6 @@ class ArizonaAPI:
|
|
774
776
|
print(f"Ошибка сети при игнорировании/отмене игнорирования пользователя {member_id}: {e}")
|
775
777
|
raise e
|
776
778
|
|
777
|
-
|
778
779
|
async def add_profile_message(self, member_id: int, message_html: str) -> aiohttp.ClientResponse:
|
779
780
|
if not self._session or self._session.closed:
|
780
781
|
raise Exception("Сессия не активна. Вызовите connect() сначала.")
|
@@ -971,6 +972,32 @@ class ArizonaAPI:
|
|
971
972
|
except aiohttp.ClientError as e:
|
972
973
|
print(f"Ошибка сети при ответе в теме {thread_id}: {e}")
|
973
974
|
raise e
|
975
|
+
|
976
|
+
async def close_thread(self, thread_id: int) -> aiohttp.ClientResponse:
|
977
|
+
if not self._session or self._session.closed:
|
978
|
+
raise Exception("Сессия не активна. Вызовите connect() сначала.")
|
979
|
+
token = await self.token
|
980
|
+
url = f"{MAIN_URL}/threads/{thread_id}/quick-close"
|
981
|
+
payload = {'_xfToken': token}
|
982
|
+
try:
|
983
|
+
response = await self._session.post(url, data=payload)
|
984
|
+
return response
|
985
|
+
except aiohttp.ClientError as e:
|
986
|
+
print(f"Ошибка сети при закрытии/открытии темы {thread_id}: {e}")
|
987
|
+
raise e
|
988
|
+
|
989
|
+
async def pin_thread(self, thread_id: int) -> aiohttp.ClientResponse:
|
990
|
+
if not self._session or self._session.closed:
|
991
|
+
raise Exception("Сессия не активна. Вызовите connect() сначала.")
|
992
|
+
token = await self.token
|
993
|
+
url = f"{MAIN_URL}/threads/{thread_id}/quick-stick"
|
994
|
+
payload = {'_xfToken': token}
|
995
|
+
try:
|
996
|
+
response = await self._session.post(url, data=payload)
|
997
|
+
return response
|
998
|
+
except aiohttp.ClientError as e:
|
999
|
+
print(f"Ошибка сети при закреплении/откреплении темы {thread_id}: {e}")
|
1000
|
+
raise e
|
974
1001
|
|
975
1002
|
async def watch_thread(self, thread_id: int, email_subscribe: bool = False, stop: bool = False) -> aiohttp.ClientResponse:
|
976
1003
|
if not self._session or self._session.closed:
|
@@ -10,7 +10,7 @@ if TYPE_CHECKING:
|
|
10
10
|
|
11
11
|
|
12
12
|
class Member:
|
13
|
-
def __init__(self, API : 'ArizonaAPI', id: int, username: str, user_title: str, avatar: str, roles: list, messages_count: int, reactions_count: int, trophies_count: int, username_color: str) -> None:
|
13
|
+
def __init__(self, API : 'ArizonaAPI', id: int, username: str, user_title: str, avatar: str, roles: list, activity: str, messages_count: int, reactions_count: int, trophies_count: int, username_color: str) -> None:
|
14
14
|
self.API = API
|
15
15
|
self.id = id
|
16
16
|
"""**ID пользователя**"""
|
@@ -22,7 +22,8 @@ class Member:
|
|
22
22
|
"""**Ссылка на аватарку пользователя**"""
|
23
23
|
self.roles = roles
|
24
24
|
"""Роль пользователя на форуме ('покраска')"""
|
25
|
-
|
25
|
+
self.activity = activity
|
26
|
+
"""**Активность пользователя на форуме**"""
|
26
27
|
self.messages_count = messages_count
|
27
28
|
"""**Количество сообщений в счетчике**"""
|
28
29
|
self.reactions_count = reactions_count
|
@@ -46,6 +46,12 @@ class Thread:
|
|
46
46
|
"""
|
47
47
|
|
48
48
|
return await self.API.answer_thread(self.id, message_html)
|
49
|
+
|
50
|
+
async def close(self) -> aiohttp.ClientResponse:
|
51
|
+
return await self.API.close_thread(self.id)
|
52
|
+
|
53
|
+
async def pin(self) -> aiohttp.ClientResponse:
|
54
|
+
return await self.API.pin_thread(self.id)
|
49
55
|
|
50
56
|
|
51
57
|
async def watch(self, email_subscribe: bool = False, stop: bool = False) -> aiohttp.ClientResponse:
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
5
5
|
|
6
6
|
setup(
|
7
7
|
name="arizona-forum-api-async",
|
8
|
-
version="1.
|
8
|
+
version="1.3",
|
9
9
|
author="fakelag28",
|
10
10
|
author_email="fakelag712@gmail.com",
|
11
11
|
description="Асинхронная Python библиотека для взаимодействия с форумом Arizona RP (forum.arizona-rp.com) без необходимости получения API ключа.",
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/exceptions.py
RENAMED
File without changes
|
{arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{arizona_forum_api_async-1.2 → arizona_forum_api_async-1.3}/arizona_forum_async/models/other.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|