OpenXbox / xbox-webapi-python

A python library to authenticate with Xbox Live via your Microsoft Account and provides Xbox related Web-API.
https://pypi.python.org/pypi/xbox-webapi
MIT License
175 stars 44 forks source link

xbox-xal command now found #90

Closed nightsurge closed 1 year ago

nightsurge commented 1 year ago

I'm not a python user at all, so apologies if this is basic stuff. But I saw the setup.py references the xbox-xal command for the relevant script. However, when I run it, I get "command not found" on MacOS.

/Users/me ~ xbox-xal
zsh: command not found: xbox-xal

I then cloned the repo and tried to run it directly:

xbox-webapi-python (me: master) ~ python xbox/webapi/scripts/xal.py
Traceback (most recent call last):
  File "/Users/me/projects/xbox-webapi-python/xbox/webapi/scripts/xal.py", line 13, in <module>
    from xbox.webapi.authentication.models import (
ImportError: cannot import name 'SisuAuthorizationResponse' from 'xbox.webapi.authentication.models' (/Users/me/.pyenv/versions/3.9.0/lib/python3.9/site-packages/xbox/webapi/authentication/models.py)

I really want to test these new tokens and API calls with gameclips and screenshots, can we improve the readme on how to make these calls? Should it be stupid easy to use the API classes in the repo for a python noob like me? 😅

tuxuser commented 1 year ago

Tried in a fresh environment:

URL: https://login.live.com/oauth20_authorize.srf?lw=1&fl=dob,easi2&xsup=1&display=android_phone&code_challenge=$&code_challenge_method=S256&state=$&client_id=000000004C20A908&response_type=code&scope=service%3A%3Auser.auth.xboxlive.com%3A%3AMBI_SSL&redirect_uri=ms-xal-public-beta-000000004c20a908%3A%2F%2Fauth&nopa=2

Provide redirect URI:


- Open the URL in browser, toggle Dev Tools, Network tab
- When auth finished, copy URL Link from network tab which starts with `?code=`
- Paste into the CLI window
- Hit ENTER
- Expected output:
Finished authentication, writing tokens to /home/username/.local/share/xbox/xal_tokens.json ``` NOTE: It's currently not possible to use the received token with XboxLiveClient session in this lib, the abstraction for that is missing. Currently have no idea how to properly implement it. When it's ready-to-use, the README / docs will get updated.