Skip to main content

ITD client for python

Project description

pyClient

Клиент ITD для python

Установка

pip install itd-iter-api

Пример

from iter import Client

c = Client() # вход через встроенный браузер или из файла
c = Client(email='mail@example.com', password='1234') # вход через встроенный браузер и автозаполнение или из файла
c = Client(token='afvrc...', cookies='refresh_token=...;__ddg1=...; ...') # вход используя токен и куки или из файла
c = Client(use_manual_login=False) # можно отключить вход через браузер
c = Client(session_file='session.jsoon') # файл сессии с токеном и куки

print(c.get_me())

Скрипт на обновление имени

Этот код сейчас работает на @itd_sdk (обновляется имя и пост)

from itd import Client
from time import sleep
from random import randint
from datetime import datetime
from datetime import timezone

c = Client(None, '...')

while True:
    c.update_profile(display_name=f'PYTHON ITD SDK | Рандом: {randint(1, 100)} | {datetime.now().strftime("%m.%d %H:%M:%S")}')
    sleep(1)

Скрипт на смену баннера

from itd import Client

c = Client(None, '...')

id = c.upload_file('любое-имя.png', open('реальное-имя-файла.png', 'rb'))['id']
c.update_profile(banner_id=id)
print('баннер обновлен')

Встроенные запросы

Существуют встроенные эндпоинты для комментариев, хэштэгов, уведомлений, постов, репортов, поиска, пользователей, итд.

c.get_user('ITD_API') # получение данных пользователя
c.get_me() # получение своих данных (me)
c.update_profile(display_name='22:26') # изменение данных профиля, например имя, био итд
c.create_post('тест1') # создание постов
# итд

Кастомные запросы

from iter.request import fetch

fetch(c.token, 'метод', 'эндпоинт', {'данные': 'данные'})

Из методов поддерживается get, post, put итд, которые есть в requests К названию эндпоинта добавляется домен итд и api, то есть в этом примере отпарвится https://xn--d1ah4a.com/api/эндпоинт.

[!NOTE] xn--d1ah4a.com - punycode от "итд.com"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

itd_iter_api-2.3.0.tar.gz (21.2 kB view details)

Uploaded Source

File details

Details for the file itd_iter_api-2.3.0.tar.gz.

File metadata

  • Download URL: itd_iter_api-2.3.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for itd_iter_api-2.3.0.tar.gz
Algorithm Hash digest
SHA256 6daa45d76c94f17c7073dc7ae503e3cf6c512dc953f85064c865aeaa50fb99da
MD5 25c4059cbeffd6fc2e6c29f767950617
BLAKE2b-256 3c472e503d59513613e813597371357abb431d857cf75e403b0855cecdb215e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for itd_iter_api-2.3.0.tar.gz:

Publisher: python-publish.yml on Sharkow1743/Iter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page