Skip to main content

league-client is a python package to communicate with riot servers

Project description

league-client

league-client is a python package to communicate with riot servers

We are actively developing 2.x.x version of this package, if you need the documentation or code of old version, please refer 1.x.x branch.

Installation

pip install -U league-client

Usage

RSO

from league_client.rso.auth import get_entitlements_token
from league_client.rso.auth import get_pas_token
from league_client.rso.auth import login_using_credentials
from league_client.rso.auth import login_using_ssid
from league_client.rso.chat import get_chat_affinity_server
from league_client.rso.chat import get_chat_host
from league_client.rso.userinfo import get_userinfo

# login using credentials
auth = login_using_credentials("USERNAME", "PASSWORD")

# or login using session id, if you have already logged in once
# recommended to avoid rate limit
auth = login_using_ssid(auth.ssid)

# auth object has following attributes
# auth = Auth(ssid='ey...', access_token='ey...', scope='openid link ban lol_region lol summoner offline_access', iss='https://auth.riotgames.com', id_token='ey...', token_type='Bearer', session_state='...', expires_in='3600')

# parse entitlement token
entitlements_token = get_entitlements_token(auth)

# parse pas token
pas_token = get_pas_token(auth)

# parse userinfo
userinfo = get_userinfo(auth)
# {'country': 'usa', 'sub': '...', 'lol_account': {'summoner_id': ..., 'profile_icon': ..., 'summoner_level': ..., 'summoner_name': ''}, 'email_verified': ..., 'player_plocale': ..., 'country_at': ..., 'pw': {'cng_at': ..., 'reset': ..., 'must_reset': ...}, 'lol': {'cuid': ..., 'cpid': '...', 'uid': ..., 'pid': '...', 'apid': ..., 'ploc': '...', 'lp': ..., 'active': ...}, 'original_platform_id': '...', 'original_account_id': ..., 'phone_number_verified': ..., 'photo': '...', 'preferred_username': '...', 'ban': {'restrictions': []}, 'ppid': ..., 'lol_region': [{'cuid': ..., 'cpid': '...', 'uid': ..., 'pid': '...', 'lp': ..., 'active': ...}], 'player_locale': '...', 'pvpnet_account_id': ..., 'region': {'locales': ..., 'id': '...', 'tag': '...'}, 'acct': {'type': ..., 'state': '...', 'adm': ..., 'game_name': '...', 'tag_line': '...', 'created_at': ...}, 'jti': '...', 'username': '...'}

# chat server information
get_chat_affinity_server(pas_token)  # jp1
get_chat_host(pas_token)  # jp1.chat.si.riotgames.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

league_client-2.0.1.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

league_client-2.0.1-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

Supported by

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