Package: xbox-smartglass-core
Xbox-Smartglass-CoreThis library provides the core foundation for the smartglass protocol that is used
with the Xbox One Gaming consoleFor in-depth information, check out the documentation:https://openxbox.org/smartglass-documentationNOTE: Since 29.02.2020 the following modules are integrated into core: stump, auxiliary, rest-serverNOTE: Nano module is still offered seperatelyFeaturesPower on / off the consoleGet system info (running App/Game/Title, dashboard version)Media player control (seeing content id, content app, playback actions etc.)Stump protocol (Live-TV Streaming / IR control)Title / Auxiliary stream protocol (f.e. Fallout 4 companion app)Trigger GameDVR remotelyREST ServerMajor frameworks usedXbox WebAPIhttps://github.com/OpenXbox/xbox-webapi-pythonconstruct - Binary parsinghttps://construct.readthedocs.io/cryptography - cryptography magichttps://cryptography.io/en/stable/dpkt - pcap parsinghttps://dpkt.readthedocs.io/en/latest/FastAPI - REST APIhttps://github.com/tiangolo/fastapiurwid - TUI apphttps://github.com/urwid/urwidpydantic - JSON modelshttps://github.com/samuelcolvin/pydanticInstallVia pippip install xbox-smartglass-coreSee the end of this README for development-targeted instructions.How to useThere are several command line utilities to check out::xbox-cliSome functionality, such as GameDVR record, requires authentication
with your Microsoft Account to validate you have the right to trigger
such action.To authenticate / get authentication tokens use::xbox-authenticateREST serverStart the server daemonUsage informationExample localhost:# Serve on '127.0.0.1:5557'$xbox-rest-server
INFO:Startedserverprocess[927195]INFO:Waitingforapplicationstartup.
INFO:Applicationstartupcomplete.
INFO:Uvicornrunningonhttp://127.0.0.1:5557(PressCTRL+Ctoquit)Example local network:192.168.0.100is the IP address of your computer running the server:xbox-rest-server--host192.168.0.100-p1234INFO:Startedserverprocess[927195]INFO:Waitingforapplicationstartup.
INFO:Applicationstartupcomplete.
INFO:Uvicornrunningonhttp://192.168.0.100:1234(PressCTRL+Ctoquit)REST APISince the migration from Flask framework to FastAPI, there is a nice
OpenAPI documentation available:http://{IPAddress}:{port}/docsAuthenticationIf your server runs on something else than 127.0.0.1:5557 or 127.0.0.1:8080 you
need to register your own OAUTH application onAzure ADand supply appropriate
parameters to the login-endpoint of the REST server.Check out:https://github.com/OpenXbox/xbox-webapi-python/blob/master/README.mdFallout 4 relay serviceTo forward the title communication from the Xbox to your local host
to use third-party Fallout 4 Pip boy applications or extensionsxbox-fo4-relayScreenshotsHere you can see the SmartGlass TUI (Text user interface):Development workflowReady to contribute? Here's how to set upxbox-smartglass-core-pythonfor local development.Fork thexbox-smartglass-core-pythonrepo on GitHub.Clone your fork locallygit clone git@github.com:your_name_here/xbox-smartglass-core-python.gitInstall your local copy into a virtual environment. This is how you set up your fork for local developmentpython -m venv ~/pyvenv/xbox-smartglass
source ~/pyvenv/xbox-smartglass/bin/activate
cd xbox-smartglass-core-python
pip install -e .[dev]Create a branch for local development::git checkout -b name-of-your-bugfix-or-featureMake your changes.Before pushing the changes to git, please verify they actually workpytestCommit your changes and push your branch to GitHub::git commit -m "Your detailed description of your changes."
git push origin name-of-your-bugfix-or-featureSubmit a pull request through the GitHub website.Pull Request GuidelinesBefore you submit a pull request, check that it meets these guidelines:Code includes unit-tests.Added code is properly named and documented.On major changes the README is updated.Run tests / linting locally before pushing to remote.CreditsKudos tojoeldayfor figuring out the AuxiliaryStream / TitleChannel communication first!
You can find the original implementation here:SmartGlass.CSharpThis package uses parts ofCookiecutterand theaudreyr/cookiecutter-pypackage project templateCHANGELOG1.3.0 (2020-11-02)Drop Python 3.6 supportDeprecate Authentication via TUIMajor rewrite (Migration from gevent -> asyncio)Rewrite of REST Server (Migration FLASK -> FastAPI)Adjust to xbox-webapi-python v2.0.8New OAUTH login flow1.2.2  (2020-04-03)Fix: Assign tokenfile path to flask_app (aka. REST server instance)1.2.1  (2020-03-04)cli: Python3.6 compatibility changeHOTFIX: Add xbox.handlers to packages in setup.py1.2.0  (2020-03-04)CLI scripts rewritten, supporting log/loglevel args now, main script is called xbox-cli nowAdd REPL / REPL server functionalityUpdates to README and REST server documentation1.1.2  (2020-02-29)Drop support for Python 3.5crypto: Fix deprecated cryptography functionstests: Speed up REST server tests (discovery, poweron)Update all dependencies1.1.1  (2020-02-29)FIX: Include static files for REST server in distributable packageREST: Remove deprecated packages from showing in /versions endpoint1.1.0  (2020-02-29)Clean up dependenciesMerge inxbox-smartglass-rest, deprecate standalone packageMerge inxbox-smartglass-stump, deprecate standalone packageMerge inxbox-smartglass-auxiliary, deprecate standalone packagetui: Fix crash when bringing up command menu, support ESC to exit1.0.12 (2018-11-14)Python 3.7 compatibility1.0.11 (2018-11-05)Add game_dvr_record to Console-classFix PCAP parserAdd last_error property to Console-class1.0.10 (2018-08-14)Safeguard around connect() functions, if userhash and xsts_token is NoneType1.0.9 (2018-08-11)Fix for Console instance poweronReset state after poweroffLittle fixes to TUISupport handling MessageFragments1.0.8 (2018-06-14)Use aenum library for backwards-compat withenum.Flagon py3.51.0.7 (2018-05-16)CoreProtocol.connect: Treat ConnectionResult.Pending as errorconstants.WindowsClientInfo: Update ClientVersion 15 -> 39Make CoreProtocol.start_channel take optional title_id / activity_id arguments1.0.1 (2018-05-03)First release on PyPI.