Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/n-thumann/xbox-cloud-statistics
View the current wait times of games on Xbox Cloud.
https://github.com/n-thumann/xbox-cloud-statistics
xbox-cloud xcloud
Last synced: about 2 months ago
JSON representation
View the current wait times of games on Xbox Cloud.
- Host: GitHub
- URL: https://github.com/n-thumann/xbox-cloud-statistics
- Owner: n-thumann
- License: mit
- Created: 2023-10-22T13:05:00.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-02T00:07:49.000Z (about 2 months ago)
- Last Synced: 2024-11-02T01:17:15.615Z (about 2 months ago)
- Topics: xbox-cloud, xcloud
- Language: Python
- Homepage: https://n-thumann.github.io/xbox-cloud-statistics/
- Size: 1.01 MB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xbox-cloud-statistics
A backend and frontend application to gather and visualize the current wait times on Xbox Cloud Gaming.
## Backend
### Setup
1. Run `poetry install` to install the dependencies
2. Download https://github.com/n-thumann/xbox-cloud-statistics/releases/download/results/results.tar.gz and extract it to get latest results locally (optionally)
3. Create an App registration at Microsoft Azure
- See https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app
- Use `Personal Microsoft accounts only` as `Supported account types`
- `CLIENT_ID` refers to `Application (client) ID` in Azure
- `CLIENT_SECRET` refers to the value of the client secret in Azure
4. Authenticate as a Xbox Cloud Gaming user
- Run `poetry run xbox-cloud-authenticate --client-id $CLIENT_ID --client-secret $CLIENT_SECRET`
- Open the URL displayed in your browser and log in with your Xbox Cloud Gaming account
- You will be redirected to e.g. `http://localhost/auth/callback?code=...`, paste the `code` into `xbox-cloud-authenticate` and hit enter
- The output will contain a `refresh_token`
- If you authenticated with a Free-to-Play account, this this the `F2P_TOKEN`
- If you authenticated with a Game Pass Ultimate account, this this the `GPU_TOKEN`### Usage
1. Export environment variables `CLIENT_ID` and `CLIENT_SECRET` to authenticate as the App registration
2. Export environment variables `F2P_TOKEN` and `GPU_TOKEN` to authenticate as the user
3. Run `poetry run xbox-cloud-statistics`, printing a table with the results and writing them to `./results````
➜ backend git:(main) poetry run xbox-cloud-statistics
| Game | Region | Subscription | Server time | Wait time (s) |
|----------------------------------------------|--------------------|------------------|---------------------------|-----------------|
| FORTNITE | AustraliaEast | Subscription.F2P | 2023-10-22 10:05:46+00:00 | 704 |
| FORTNITE | AustraliaEast | Subscription.GPU | 2023-10-22 10:05:47+00:00 | 38 |
| FORTNITE | AustraliaSouthEast | Subscription.F2P | 2023-10-22 10:05:46+00:00 | 704 |
| FORTNITE | AustraliaSouthEast | Subscription.GPU | 2023-10-22 10:05:47+00:00 | 38 |
| FORTNITE | BrazilSouth | Subscription.F2P | 2023-10-22 10:05:45+00:00 | 10 |
| FORTNITE | BrazilSouth | Subscription.GPU | 2023-10-22 10:05:47+00:00 | 10 |
| FORTNITE | EastUS | Subscription.F2P | 2023-10-22 10:05:45+00:00 | 10 |
[...]
```### Configuration
The configuration file ([config.toml](config.toml)) contains all games that should be queried.
The example below shows the configuration for Fortnite with Xbox Cloud ID `FORTNITE`, title `Fortnite` and image (poster) URL and the subscriptions its available in (Free-to-Play and Game Pass Ultimate):```
[games.FORTNITE]
title = "Fortnite"
image_url = "https://store-images.s-microsoft.com/image/apps.9582.70702278257994163.a9af653c-54d0-4c47-a1f0-bd2f08fe0fd1.3ea1af1a-95a6-4543-be33-94c112ed5dc3"
subscriptions = ["F2P", "GPU"]
```After adding new games to the configuration, please run `poetry run toml-sort -i config.toml` to keep them sorted.
## Frontend
### Setup
1. Run `poetry install` to install the dependencies
2. Download https://github.com/n-thumann/xbox-cloud-statistics/releases/download/results/results.tar.gz and extract it to get latest results locally
3. Run `python3 -m http.server -d dist/` to start a local HTTP server### Build
Run `poetry run site-generator` to build the static page.
https://github.com/n-thumann/xbox-cloud-statistics/assets/46975855/05949add-87a4-4710-b908-41b47aa48b0a
## Measurement data
The measurement data is available as JSON in `results.tar.gz` of [this](https://github.com/n-thumann/xbox-cloud-statistics/releases/tag/results) release.