arizona-forum-api-async 1.1.2__tar.gz → 1.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.1.2 → arizona_forum_api_async-1.1.3}/PKG-INFO +11 -2
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_api_async.egg-info/PKG-INFO +11 -2
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/api.py +22 -9
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/setup.py +1 -1
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/MANIFEST.in +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/README.md +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_api_async.egg-info/SOURCES.txt +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_api_async.egg-info/dependency_links.txt +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_api_async.egg-info/requires.txt +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_api_async.egg-info/top_level.txt +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/__init__.py +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/bypass_antibot/__init__.py +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/bypass_antibot/__pycache__/__init__.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/bypass_antibot/__pycache__/script.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/bypass_antibot/script.py +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/consts.py +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/exceptions.py +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/__init__.py +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/__pycache__/__init__.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/__pycache__/category_object.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/__pycache__/member_object.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/__pycache__/other.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/__pycache__/post_object.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/__pycache__/thread_object.cpython-313.pyc +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/category_object.py +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/member_object.py +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/other.py +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/post_object.py +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/thread_object.py +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/pyproject.toml +0 -0
- {arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: arizona-forum-api-async
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.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
|
@@ -15,6 +15,15 @@ Requires-Dist: aiohttp-socks
|
|
15
15
|
Requires-Dist: beautifulsoup4
|
16
16
|
Requires-Dist: dukpy
|
17
17
|
Requires-Dist: lxml
|
18
|
+
Dynamic: author
|
19
|
+
Dynamic: author-email
|
20
|
+
Dynamic: classifier
|
21
|
+
Dynamic: description
|
22
|
+
Dynamic: description-content-type
|
23
|
+
Dynamic: home-page
|
24
|
+
Dynamic: requires-dist
|
25
|
+
Dynamic: requires-python
|
26
|
+
Dynamic: summary
|
18
27
|
|
19
28
|
# Arizona Forum API Async
|
20
29
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: arizona-forum-api-async
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.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
|
@@ -15,6 +15,15 @@ Requires-Dist: aiohttp-socks
|
|
15
15
|
Requires-Dist: beautifulsoup4
|
16
16
|
Requires-Dist: dukpy
|
17
17
|
Requires-Dist: lxml
|
18
|
+
Dynamic: author
|
19
|
+
Dynamic: author-email
|
20
|
+
Dynamic: classifier
|
21
|
+
Dynamic: description
|
22
|
+
Dynamic: description-content-type
|
23
|
+
Dynamic: home-page
|
24
|
+
Dynamic: requires-dist
|
25
|
+
Dynamic: requires-python
|
26
|
+
Dynamic: summary
|
18
27
|
|
19
28
|
# Arizona Forum API Async
|
20
29
|
|
@@ -148,6 +148,8 @@ class ArizonaAPI:
|
|
148
148
|
params = {'_xfResponseType': 'json', '_xfToken': token}
|
149
149
|
try:
|
150
150
|
async with self._session.get(url, params=params) as response:
|
151
|
+
if response.status == 403:
|
152
|
+
return Member(self, user_id, None, None, None, [], 0, 0, 0, '#fff')
|
151
153
|
response.raise_for_status()
|
152
154
|
data = await response.json()
|
153
155
|
|
@@ -170,7 +172,7 @@ class ArizonaAPI:
|
|
170
172
|
roles_container = soup.find('div', {'class': 'memberHeader-banners'})
|
171
173
|
if roles_container:
|
172
174
|
for i in roles_container.children:
|
173
|
-
if i.text != '\n': roles.append(i.text.strip())
|
175
|
+
if i.text != '\n': roles.append(i.text.strip())
|
174
176
|
|
175
177
|
try:
|
176
178
|
user_title_tag = soup.find('span', {'class': 'userTitle'})
|
@@ -207,6 +209,11 @@ class ArizonaAPI:
|
|
207
209
|
|
208
210
|
return Member(self, user_id, username, user_title, avatar, roles, messages_count, reactions_count, trophies_count, username_color)
|
209
211
|
|
212
|
+
except aiohttp.ClientResponseError as e:
|
213
|
+
if e.status == 403:
|
214
|
+
return Member(self, user_id, None, None, None, [], 0, 0, 0, '#fff')
|
215
|
+
print(f"Ошибка сети при получении пользователя {user_id}: {e}")
|
216
|
+
return None
|
210
217
|
except aiohttp.ClientError as e:
|
211
218
|
print(f"Ошибка сети при получении пользователя {user_id}: {e}")
|
212
219
|
return None
|
@@ -314,11 +321,10 @@ class ArizonaAPI:
|
|
314
321
|
try:
|
315
322
|
creator = await self.get_member(creator_id)
|
316
323
|
except Exception as e:
|
317
|
-
|
324
|
+
creator = Member(self, creator_id, None, None, None, None, None, None, None, None)
|
318
325
|
if not creator:
|
319
326
|
creator = Member(self, creator_id, creator_info_tag.text, None, None, None, None, None, None, None)
|
320
327
|
else:
|
321
|
-
print(f"Не удалось найти информацию о создателе для поста {post_id}")
|
322
328
|
return None
|
323
329
|
|
324
330
|
thread = None
|
@@ -368,12 +374,13 @@ class ArizonaAPI:
|
|
368
374
|
creator_tag = post_article.find('a', {'class': 'username'})
|
369
375
|
if creator_tag and creator_tag.has_attr('data-user-id'):
|
370
376
|
creator_id = int(creator_tag['data-user-id'])
|
371
|
-
|
377
|
+
try:
|
378
|
+
creator = await self.get_member(creator_id)
|
379
|
+
except Exception as e:
|
380
|
+
creator = Member(self, creator_id, None, None, None, [], 0, 0, 0, '#fff')
|
372
381
|
if not creator:
|
373
|
-
print(f"Не удалось получить создателя ({creator_id}) для поста профиля {post_id}")
|
374
382
|
return None
|
375
383
|
else:
|
376
|
-
print(f"Не удалось найти ID создателя для поста профиля {post_id}")
|
377
384
|
return None
|
378
385
|
|
379
386
|
profile_owner = None
|
@@ -450,9 +457,12 @@ class ArizonaAPI:
|
|
450
457
|
latest_member_link = latest_member_dl.find('a', {'data-user-id': True})
|
451
458
|
if latest_member_link and latest_member_link.has_attr('data-user-id'):
|
452
459
|
last_user_id = int(latest_member_link['data-user-id'])
|
453
|
-
|
460
|
+
try:
|
461
|
+
last_register_member = await self.get_member(last_user_id)
|
462
|
+
except Exception as e:
|
463
|
+
last_register_member = Member(self, last_user_id, None, None, None, [], 0, 0, 0, '#fff')
|
454
464
|
except (AttributeError, ValueError, Exception) as e:
|
455
|
-
|
465
|
+
pass
|
456
466
|
|
457
467
|
|
458
468
|
return Statistic(self, threads_count, posts_count, users_count, last_register_member)
|
@@ -672,7 +682,10 @@ class ArizonaAPI:
|
|
672
682
|
return None
|
673
683
|
|
674
684
|
parent_category_id = int(parent_category_id_str)
|
675
|
-
|
685
|
+
try:
|
686
|
+
return await self.get_category(parent_category_id)
|
687
|
+
except Exception as e:
|
688
|
+
return None
|
676
689
|
except aiohttp.ClientError as e:
|
677
690
|
print(f"Ошибка сети при получении родительской категории для {category_id}: {e}")
|
678
691
|
return None
|
@@ -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.1.
|
8
|
+
version="1.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
|
{arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/consts.py
RENAMED
File without changes
|
{arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/exceptions.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
|
File without changes
|
File without changes
|
{arizona_forum_api_async-1.1.2 → arizona_forum_api_async-1.1.3}/arizona_forum_async/models/other.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|