itdirr
Расширенный форк ITDpy — неофициальный Python SDK для итд.com
Форк сделан IRRatium.
Неофициальный API-клиент. SDK предназначен для разработки приложений и автоматизации в рамках правил платформы.
📚 Документация | 🐍 PyPI | 💻 GitHub
Отличия от оригинала
| Функция | ITDpy | itdirr |
|---|---|---|
Статус онлайн (keep_online) |
❌ | ✅ |
Стена (get_wall, post_to_wall) |
❌ | ✅ |
Просмотры постов (view_post) |
❌ | ✅ |
Смена юзернейма (set_username) |
❌ | ✅ |
| Посты, комментарии, уведомления | ✅ | ✅ |
| Пины, опросы, настройки | ✅ | ✅ |
| Поиск, дискавери | ✅ | ✅ |
Установка
pip install itdirr
Или через git:
git clone https://github.com/IRRatium/itdirr
cd itdirr
pip install -e .
Быстрый старт
from itdirr import ITDClient
client = ITDClient(refresh_token="ваш_токен")
me = client.get_me()
print(me.username)
print(me.display_name)
print(me.followers_count)
Как получить refresh_token
- Открой итд.com в браузере и войди в аккаунт
- Открой DevTools (F12) → Application → Cookies
- Найди куку
refresh_tokenи скопируй значение
Возможности
Пользователи
me = client.get_me()
user = client.get_user("gam5510")
print(user.bio, user.followers_count, user.online)
client.follow_user("gam5510")
client.unfollow_user("gam5510")
followers = client.get_followers("gam5510", page=1, limit=30)
following = client.get_following("gam5510")
Профиль
client.update_profile(display_name="Новое имя", bio="Описание")
# Быстрая смена юзернейма
client.set_username("coolname42")
# Загрузить баннер
file = client.upload_file("banner.gif")
client.update_profile(banner_id=file.id)
Посты
posts = client.get_posts(limit=20, tab="popular") # popular / newest / oldest
post = client.create_post("Привет!")
# С HTML-форматированием
post = client.create_post("<b>Жирный</b> и <i>курсив</i>", parse_html=True)
# С опросом
post = client.create_post(
content="Голосуем!",
poll={"question": "Лучший язык?", "options": ["Python", "Go", "Rust"]}
)
# С медиафайлом
file = client.upload_file("photo.jpg")
post = client.create_post("Фото!", attachment_ids=[file.id])
client.like_post(post.id)
client.unlike_post(post.id)
client.repost_post(post.id, content="Мой комментарий") # content обязателен
client.view_post(post.id)
client.delete_post(post.id)
posts = client.get_user_posts("gam5510")
Комментарии
comments = client.get_comments(post_id, limit=20, sort="popular")
comment = client.create_comment(post_id, "Отличный пост!")
client.reply_to_comment(comment.id, "Согласен!")
client.like_comment(comment.id)
client.delete_comment(comment.id)
replies = client.get_replies(comment.id)
Стена ✨
wall = client.get_wall("gam5510")
client.post_to_wall("gam5510", "Привет!")
Статус онлайн ✨
# Держать онлайн в фоне — одна строка
client.keep_online()
# С обработкой событий в реальном времени
def on_event(event_type, data):
if event_type == "like":
print("Новый лайк!")
elif event_type == "comment":
print("Новый комментарий!")
elif event_type == "follow":
print("Новый подписчик!")
client.keep_online(on_event=on_event)
# Блокирующий режим
client.keep_online(background=False)
Уведомления
notifications = client.get_notifications(limit=20)
for n in notifications:
print(n.type, n.actor.username)
client.mark_notification_read(notification_id)
client.mark_all_notification_read() # отмечает все сразу
Пины
pins = client.get_pins()
client.set_pin(slug="kirill67_202602_infected")
client.remove_pin()
Настройки
client.update_privacy(
is_private=True,
wall_access="followers", # everyone / followers / mutual / nobody
likes_visibility="mutual",
show_last_seen=False,
)
client.update_notification_settings(
likes=True,
comments=True,
sound=False,
)
Поиск и дискавери
results = client.search("python")
posts = client.search_hashtags("python")
trends = client.get_trending_hashtags(limit=10)
suggestions = client.who_to_follow()
Опросы
post = client.get_post(post_id)
client.vote(post.id, option_ids=post.poll.options[0].id)
Кастомные запросы
response = client.get("/api/users/me")
data = response.json()
response = client.post("/api/posts", json={"content": "Привет!"})
client.put("/api/users/me", json={"displayName": "Новое имя"})
client.delete("/api/posts/POST_ID")
response = client.get("/api/posts", params={"limit": 50, "sort": "popular"})
Модели
| Модель | Описание |
|---|---|
Me |
Текущий пользователь |
User |
Профиль пользователя |
UserLite |
Краткий профиль (в постах, комментариях) |
Post |
Пост |
Posts |
Список постов с пагинацией |
Comment |
Комментарий |
Notification |
Уведомление |
Poll / PollOption |
Опрос |
Pin / Pins |
Пины профиля |
Attachment |
Медиафайл |
PrivacySettings |
Настройки приватности |
NotificationSettings |
Настройки уведомлений |
Все модели на Pydantic v2, автоматический маппинг camelCase → snake_case.
Документация
Планы
- Async-клиент (
asyncio) - Логирование через
logging - Новые эндпоинты по мере появления
Благодарности
Оригинальная библиотека — ITDpy by Gam5510
Лицензия
MIT © IRRatium
Metadata
Release files for itdirr 0.7.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| itdirr-0.7.7.tar.gz | 25.8 kB | Without provenance | Details for itdirr-0.7.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| itdirr-0.7.7-py3-none-any.whl | Python 3 | none | any | Details for itdirr-0.7.7-py3-none-any.whl |
Total release size: 62.8 kB
Release files / itdirr-0.7.7.tar.gz
| Download URL | itdirr-0.7.7.tar.gz |
|---|---|
| Size | 25.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c266522457c67eb6f8c70af3017e9dca3bd8e015126e0d4fa63cd15da9c434aa
|
|
BLAKE2b-256 checksum How to use checksums |
ebfe54f9b9f0a55cdb41152be86e794c4443c9379f06673d8b907d6ca1049816
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / itdirr-0.7.7-py3-none-any.whl
| Download URL | itdirr-0.7.7-py3-none-any.whl |
|---|---|
| Size | 37.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ea9a9f7c6c92c1aa5e2f9c8bb9c8259e2d5ae8102bbb52669986242075cf1a0
|
|
BLAKE2b-256 checksum How to use checksums |
bcf50f2cd49c2e594768dfd74e00b1fb5322039983ba714df0bb93d6b0a7a921
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for itdirr 0.7.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.