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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for league_client-2.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 882c9f2659de88226357733c8afaa46ef5ad2088decca47b1775e861d8465860 |
|
MD5 | d904bfec5e7dabaea91f54fc6d824a23 |
|
BLAKE2b-256 | b00ab17c16c92671e083139149be35ec541b3d69ef92edd8f61a0ce971f9cf58 |