Skip to main content

A Python package, command line interface and MCP server to control video players for MultiViewer, the best way to watch Formula 1.

https://dl.circleci.com/status-badge/img/gh/RobSpectre/mvf1/tree/main.svg?style=svg https://codecov.io/gh/RobSpectre/mvf1/branch/main/graph/badge.svg?token=L5N96KXN2V Documentation Status

Table of Contents

Features

Installation

The latest version can be installed via pip.

$ pip install mvf1

Quickstart

Command Line

$ mvf1-cli --help

Model Context Protocol (MCP) Server

$ mvf1-cli mcp

To use in an AI agent, use your framework’s affordance for a stdio MCP server.

Here is an example with PydanticAI.

from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStdio

server = MCPServerStdio(
    'mvf1-cli',
    args=[
        'mcp'
    ]
)
agent = Agent('openai:gpt-4o', mcp_servers=[server])

Library

Displaying all players

>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> remote.players
[6: INTERNATIONAL, 7: PER]

Pause all players

>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> for player in remote.players:
>>>     player.mute()
{'data': {'playerSetMuted': True}}
{'data': {'playerSetMuted': True}}

Retrieve specific player

>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> player = remote.player(6)
>>> player.state
{'ts': 1677168293.21, 'paused': False, 'muted': True, 'volume': 100, 'live': False, 'currentTime': 10.002025, 'interpolatedCurrentTime': 363.656025}

Switch stream of player to data channel

>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> player = remote.player(6)
>>> player.switch_stream('DATA')
{'data': {'playerCreate': '12'}}

Synchronize all players to specific player

>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> player = remote.player(6)
>>> player.sync()
{'data': {'playerSync': True}}

Synchornize all players to player streaming broadcast commentary

>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> remote.player_sync_to_commentary()
{'data': {'playerSync': True}}

Synchronize open players to live timing

>>> from mvf1 import MultiViewerForF1
>>> remote = MultiViewerForF1()
>>> remote.player_sync_to_live_timing()
{'data': {'meeting_id': '1279', 'session_id': '11234', 'synced_players': [...]}}

The same operation is available to MCP clients as player_sync_to_live_timing. It uses the current live-timing clock, session start, and each feed’s signed offset to seek matching open players to the first open player’s session.

Development

Hacking

To hack on the project, clone the GitHub repo:

$ git clone https://github.com/RobSpectre/mvf1

Then install in a virtualenv.

$ pip install -e ./

Test

The project uses tox for tests. Simply run from project root

$ tox

Meta

  • Written by Rob Spectre.

  • Released under MIT License.

  • Software is as is - no warranty expressed or implied, diggity.

  • This package is not developed or maintained by MultiViewer or Formula 1 TV.

  • Shout out to the excellent MultiViewer team! This app absolutely changed how I enjoy Formula 1.

  • 🏎️ Go Weeyums! 🏎️

Release files for mvf1 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mvf1 2.1.1
File Size Uploaded
mvf1-2.1.1.tar.gz 26.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mvf1 2.1.1
File Interpreter ABI Platform
mvf1-2.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 47.8 kB

Release files / mvf1-2.1.1.tar.gz

Download URL mvf1-2.1.1.tar.gz
Size 26.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e5d3667b156fe0c733e12a6accc49e0d3c3de823b8c4557590d2488d31d423e3
BLAKE2b-256 checksum
How to use checksums
9496fe604d5e7b8dd04e4a0fdfccc0ade4bc689880075ee72368da021cfeef5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / mvf1-2.1.1-py3-none-any.whl

Download URL mvf1-2.1.1-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06f26d67ec7b7735b728fb3662268777d59397c67853b32aac9241e4413d1047
BLAKE2b-256 checksum
How to use checksums
3efbeeaf846bf668e95377d9e2bee40420c124a6c674154f10684fe255a1333c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

2.1.1 This release

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.4

2 release files

1.1.3

1 release file

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page