Skip to main content

A library to interact with the Xbox One gaming console via the SmartGlass protocol.

Project description

Xbox-Smartglass-Core

Latest Version Documentation Status https://travis-ci.com/OpenXbox/xbox-smartglass-core-python.svg?branch=master Docker Build Status Discord chat channel

This library provides the core foundation for the smartglass protocol that is used with the Xbox One Gaming console

For in-depth information, check out the documentation: (https://openxbox.org/smartglass-documentation)

NOTE: Since 29.02.2020 the following modules are integrated into core: stump, auxiliary, rest-server

NOTE: Nano module is still offered seperately

Features

  • Power on / off the console

  • Get 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 remotely

  • REST Server

Frameworks used

Install

Via pip:

pip install xbox-smartglass-core

See the end of this README for development-targeted instructions.

How to use

There are several command line utilities to check out:

$ xbox-cli

Some 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-authenticate

# Alternative: Use the ncurses terminal ui, it has authentication integrated
$ xbox-tui

REST Server

Start the REST server:

$ xbox-rest-server

For more information consult RestFAQ

Fallout 4 relay service

To forward the title communication from the Xbox to your local host to use third-party Fallout 4 Pip boy applications or extensions:

xbox-fo4-relay

Screenshots

Here you can see the SmartGlass TUI (Text user interface):

https://raw.githubusercontent.com/OpenXbox/xbox-smartglass-core-python/master/assets/xbox_tui_list.png https://raw.githubusercontent.com/OpenXbox/xbox-smartglass-core-python/master/assets/xbox_tui_console.png https://raw.githubusercontent.com/OpenXbox/xbox-smartglass-core-python/master/assets/xbox_tui_log.png https://raw.githubusercontent.com/OpenXbox/xbox-smartglass-core-python/master/assets/xbox_tui_logdetail.png

Development workflow

Ready to contribute? Here’s how to set up xbox-smartglass-core-python for local development.

  1. Fork the xbox-smartglass-core-python repo on GitHub.

  2. Clone your fork locally:

    $ git clone git@github.com:your_name_here/xbox-smartglass-core-python.git
  3. Install your local copy into a virtual environment. This is how you set up your fork for local development:

    $ python -m venv ~/pyvenv/xbox-smartglass
    $ source ~/pyvenv/xbox-smartglass/bin/activate
    $ cd xbox-smartglass-core-python
    $ pip install -e .[dev]
  4. Setup auto-linting before each commit via pre-commit:

    $ pre-commit install
  5. Create a branch for local development:

    $ git checkout -b name-of-your-bugfix-or-feature
  6. Make your changes.

  7. Before pushing the changes to git, please verify they actually work:

    $ pre-commit run -a
    $ pytest
    
    # For more extensive testing on several frameworks:
    $ tox
  8. Commit 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-feature
  9. Submit a pull request through the GitHub website.

Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:

  1. Code includes unit-tests.

  2. Added code is properly named and documented.

  3. On major changes the README is updated.

  4. Run tests / linting locally before pushing to remote.

Credits

Kudos to joelday for figuring out the AuxiliaryStream / TitleChannel communication first! You can find the original implementation here: SmartGlass.CSharp.

This package uses parts of Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

1.2.1 (2020-03-04)

  • cli: Python3.6 compatibility change

  • HOTFIX: Add xbox.handlers to packages in setup.py

1.2.0 (2020-03-04)

  • CLI scripts rewritten, supporting log/loglevel args now, main script is called xbox-cli now

  • Add REPL / REPL server functionality

  • Updates to README and REST server documentation

1.1.2 (2020-02-29)

  • Drop support for Python 3.5

  • crypto: Fix deprecated cryptography functions

  • tests: Speed up REST server tests (discovery, poweron)

  • Update all dependencies

1.1.1 (2020-02-29)

  • FIX: Include static files for REST server in distributable package

  • REST: Remove deprecated packages from showing in /versions endpoint

1.1.0 (2020-02-29)

  • Clean up dependencies

  • Merge in xbox-smartglass-rest, deprecate standalone package

  • Merge in xbox-smartglass-stump, deprecate standalone package

  • Merge in xbox-smartglass-auxiliary, deprecate standalone package

  • tui: Fix crash when bringing up command menu, support ESC to exit

1.0.12 (2018-11-14)

  • Python 3.7 compatibility

1.0.11 (2018-11-05)

  • Add game_dvr_record to Console-class

  • Fix PCAP parser

  • Add last_error property to Console-class

1.0.10 (2018-08-14)

  • Safeguard around connect() functions, if userhash and xsts_token is NoneType

1.0.9 (2018-08-11)

  • Fix for Console instance poweron

  • Reset state after poweroff

  • Little fixes to TUI

  • Support handling MessageFragments

1.0.8 (2018-06-14)

  • Use aenum library for backwards-compat with _enum.Flag_ on py3.5

1.0.7 (2018-05-16)

  • CoreProtocol.connect: Treat ConnectionResult.Pending as error

  • constants.WindowsClientInfo: Update ClientVersion 15 -> 39

  • Make CoreProtocol.start_channel take optional title_id / activity_id arguments

1.0.1 (2018-05-03)

  • First release on PyPI.

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

xbox-smartglass-core-1.2.1.tar.gz (391.1 kB view details)

Uploaded Source

Built Distribution

xbox_smartglass_core-1.2.1-py2.py3-none-any.whl (84.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file xbox-smartglass-core-1.2.1.tar.gz.

File metadata

  • Download URL: xbox-smartglass-core-1.2.1.tar.gz
  • Upload date:
  • Size: 391.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7

File hashes

Hashes for xbox-smartglass-core-1.2.1.tar.gz
Algorithm Hash digest
SHA256 5de8d40040bd9151cfbfd01d6bae3f3d85e3c49b4f85d6708a2007b01577eef5
MD5 0f42a11d2cc195b0be0c9c39245a6e89
BLAKE2b-256 6f43c190cbf6ba28b46c4b7df15cb13e570e0177d36b20287f33bd0284843c84

See more details on using hashes here.

File details

Details for the file xbox_smartglass_core-1.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: xbox_smartglass_core-1.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 84.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7

File hashes

Hashes for xbox_smartglass_core-1.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6f75d2b3dcd677360e32f55b1fde6fe130c86fc5bd8c26515e7afae665f830e7
MD5 bb6dd966a0f4e245fd69fea1ca2cc471
BLAKE2b-256 460f728587720e0541cb036a727b246fbfb71e1038a0347c74f408b928c0a245

See more details on using hashes here.

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