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.github.io)

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)

  • REST Server

Frameworks used

Install

Via pip:

pip install xbox-smartglass-core

How to use

Authenticate first (Authentication provided by xbox-webapi-python):

$ xbox-authenticate

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

Now have a look in the Documentation how to use the provided shell-scripts!

REST Server

Start the REST server

$ xbox-rest-server

Incase you run into a problem, check out RestFAQ

REST Server - Authentication

Authenticate from scratch

For non-2FA enabled account: http://localhost:5557/auth/login
For 2FA: http://localhost:5557/auth/oauth

# Store tokens on valid authentication
http://localhost:5557/auth/store

Load tokens from disk

http://localhost:5557/auth/load
http://localhost:5557/auth/refresh

2FA OAuth - POST

# Get authorize url
GET http://localhost:5557/auth/url
Response-Parameters (JSON): authorization_url

# Submit redirect url
POST http://localhost:5557/auth/oauth
Request-Parameters: redirect_uri

Regular (non-2FA) login - POST

POST http://localhost:5557/auth/login
Request-Parameters: email, password

REST Server - General usage

To see all API endpoints:

http://localhost:5557

Usual usage:

# (Optional) Poweron console
http://localhost:5557/device/<liveid>/poweron
# NOTE: You can specify device by ip: /device/<liveid>/poweron?addr=192.168.0.123
# Enumerate devices on network
# NOTE: You can enumerate device by specific ip: /device?addr=192.168.0.123
http://localhost:5557/device
# Connect to console
# NOTE: You can connect anonymously: /connect?anonymous=true
# .. if console allows it ..
http://localhost:5557/device/<liveid>/connect

# Use other API endpoints ...

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

Known issues

  • Find, report and/or fix them ;)

Contribute

  • Report bugs/suggest features

  • Add/update docs

  • Enhance managers

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.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.1.2.tar.gz (389.4 kB view details)

Uploaded Source

Built Distribution

xbox_smartglass_core-1.1.2-py2.py3-none-any.whl (84.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: xbox-smartglass-core-1.1.2.tar.gz
  • Upload date:
  • Size: 389.4 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.1.2.tar.gz
Algorithm Hash digest
SHA256 30b3fcb79a6492cf5656a8125eb75e0e3ad8ba5e331c401cb0f437b4814fe8ef
MD5 ff01e35ce1d4fa800c0d7579cc9791c1
BLAKE2b-256 40c8d856d7bae071c5442daaebfa3c03849ba95eba01971693644614700f3131

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xbox_smartglass_core-1.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 84.8 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.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 51f79ecda92f7081f3d4bbffb0e6d000bf1ff24b40e730f0f4163364112e29df
MD5 0f67f64ab3cd287c2ee4deb71d3b33ee
BLAKE2b-256 37df5ef7d93a2a2515f12337c01594d7ab70c110774cece406c010203a5d7ab3

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