Сообщение от TastyBread123
Всех приветствую
Как вы могли догадаться, это API для интернет ресурсов аризоны. Можете потыкать по спойлерам для большей информации
Github |Релизы |Документация
Цитата:
Сообщение от Спойлер
Не используйте способ с document.cookie в консоли JavaScript. Для этого лучше использовать отдельные расширения для работы с куки. Например, EditThisCookie или Cookie-Editor
|
Примеры:
Цитата:
Сообщение от Спойлер
Код:
Код:
import
arz_api
cookies
=
{
"xf_user"
:
"your"
,
"xf_tfa_trust"
:
"your"
,
"xf_session"
:
"your"
,
"xf_csrf"
:
"your"
,
}
api
=
arz_api
.
ArizonaAPI
(
user_agent
=
"your"
,
cookie
=
cookies
)
user
=
api
.
current_member
print
(
f'Успешно авторизовались!\nИмя пользователя:{user.username}| Звание:{user.user_title}\nАватарка:{user.avatar}\nСообщений:{user.messages_count}| Реакций:{user.reactions_count}\n'
)
category
=
api
.
get_category
(
1865
)
print
(
f"Название:{category.title}({category.id})\nСтраниц:{category.pages_count}\n"
)
member
=
api
.
get_member
(
583439
)
print
(
f'Пользователь найден!\nИмя пользователя:{member.username}| Звание:{member.user_title}\nАватарка:{member.avatar}\nСообщений:{member.messages_count}| Реакций:{member.reactions_count}\n'
)
thread
=
api
.
get_thread
(
6594323
)
print
(
f'Название:{thread.title}({thread.id})\nАвтор темы:{thread.creator.username}\nКатегория:{thread.category.title}({thread.category.id})\nДата создания:{thread.create_date}| Закрыто:{thread.is_closed}'
)
statistic
=
api
.
get_forum_statistic
(
)
print
(
f'\n\nТем:{statistic.threads_count}| Постов:{statistic.posts_count}| Пользователей:{statistic.users_count}\nПоследний пользователь:{statistic.last_register_member.username}'
)
post
=
api
.
get_post
(
36550558
)
print
(
f'\n\nАвтор:{post.creator.username}({post.creator.id})\nID:{post.id}| Дата создания:{post.create_date}\nРазмещено в теме{post.thread.title}\n\n{post.bb_content}'
)
profile_post
=
api
.
get_profile_post
(
2247012
)
print
(
f"\n\nАвтор:{profile_post.creator.username}({profile_post.creator.id})\nСоздано в{profile_post.create_date}у пользователя{profile_post.profile.username}({profile_post.profile.id})\n\n{profile_post.bb_content}"
)
|
Цитата:
Сообщение от Спойлер
Отсюда
Код:
Код:
import
arz_api
cookies
=
{
"xf_user"
:
"your"
,
"xf_tfa_trust"
:
"your"
,
"xf_session"
:
"your"
,
"xf_csrf"
:
"your"
}
api
=
arz_api
.
ArizonaAPI
(
user_agent
=
"your"
,
cookie
=
cookies
)
for
thread_id
in
api
.
get_threads
(
1583
)
:
thread
=
api
.
get_thread
(
thread_id
)
print
(
f"{thread.title}by{thread.creator.username}"
)
|
Цитата:
Сообщение от Спойлер
Отсюда
Код:
Код:
import
arz_api
cookies
=
{
"xf_user"
:
"your"
,
"xf_tfa_trust"
:
"your"
,
"xf_session"
:
"your"
,
"xf_csrf"
:
"your"
}
try
:
api
=
arz_api
.
ArizonaAPI
(
user_agent
=
"your"
,
cookie
=
cookies
)
print
(
'Success login! Getting last posts in your profile...'
)
for
post_id
in
api
.
current_member
.
get_profile_messages
(
)
:
post
=
api
.
get_profile_post
(
post_id
)
print
(
"\nMessage ID: {0}\nFrom: {1}\nText: {2}\nUnformatted text: {3}"
.
format
(
post
.
creator
.
id
,
post
.
creator
.
username
,
post
.
text_content
,
post
.
bb_content
)
)
except
arz_api
.
IncorrectLoginData
:
print
(
'Invalid login data!'
)
|
Цитата:
Сообщение от Спойлер
Код:
Код:
import
arz_api
cookies
=
{
"xf_user"
:
"your"
,
"xf_tfa_trust"
:
"your"
,
"xf_session"
:
"your"
,
"xf_csrf"
:
"your"
}
api
=
arz_api
.
ArizonaAPI
(
user_agent
=
"your"
,
cookie
=
cookies
)
# ПРИМЕР ДЛЯ PAYSON
jb
=
api
.
send_form
(
45
,
{
'question[531]'
:
'1'
,
# Тип жалобы (1 - на адм / 2 - на красных), в этом примере на адм (в жб на красных id полей различаются)
'question[532]'
:
"Your_Nick"
,
# Ваш ник
'question[533]'
:
"Admin_Nick"
,
# Ник администратора
'question[534]'
:
"ДМ ЗЗ"
,
# Причина наказания
'question[535]'
:
"ВИ ПЛАХИЕ ОПРУ ИЛИ СНИМАЙТИ ОДМЕНА"
,
# Суть жалобы
'question[536]'
:
"https://imgur.com/a/rfFsf"
,
#Скриншот истории наказаний
'question[537]'
:
"https://imgur.com/a/fGFYj"
,
# Скриншот при входе в игру (при бане)
'question[538]'
:
"2023-07-10"
,
# Дата выдачи наказания
'question[539]'
:
'1'
# Готов нести ответственность в случае обмана
}
)
|
Цитата:
Сообщение от Спойлер
Вроде как имеется (не тестировал). Дополнительно можете при авторизации отключить обход, поставив параметр do_bypass = False
Без обхода:
Код:
api
=
ArizonaAPI
(
user_agent
=
"your"
,
cookie
=
cookies
,
do_bypass
=
False
)
|
Пока что API в стадии разработки, поэтому если найдете баги или есть предложения - пишите сюда
|