Mvf1

مجتمعي أخرى

Control MultiViewer, an app for watching motorsports like Formula 1, World Endurance Championship and IndyCar.

التثبيت

خطوات التثبيت موجودة في التوثيق أدناه. التوثيق

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. Table of Contents
  2. Features
  3. Installation
  4. Quickstart
  5. Command Line
  6. Model Context Protocol (MCP) Server
  7. Library
  8. Development
  9. Hacking
  10. Test
  11. Meta

mvf1


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

.. image:: https://dl.circleci.com/status-badge/img/gh/RobSpectre/mvf1/tree/main.svg?style=svg :target: https://dl.circleci.com/status-badge/redirect/gh/RobSpectre/mvf1/tree/main

.. image:: https://codecov.io/gh/RobSpectre/mvf1/branch/main/graph/badge.svg?token=L5N96KXN2V :target: https://codecov.io/gh/RobSpectre/mvf1

.. image:: https://readthedocs.org/projects/mvf1/badge/?version=latest :target: https://mvf1.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status

Table of Contents

.. contents:: :local: :depth: 1 :backlinks: none

Features

  • Command line interface for controlling MultiViewer. Useful for integrations with control interfaces like StreamDeck
  • Pythonic interface for controlling MultiViewer_. No GraphQL needed!
  • MCP server for controlling MultiViewer_ - perfect for controlling the broadcast for with AI agents.
  • Type hints_
  • Full documentation_
  • Test coverage_
  • black_ Praise the Dark Lord

Installation

The latest version can be installed via pip_.

.. code-block:: bash

$ pip install mvf1

Quickstart

Command Line

.. code-block:: bash

$ mvf1-cli --help

Model Context Protocol (MCP) Server

.. code-block:: bash

$ 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.

.. code-block:: python

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

.. code-block:: python

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

Pause all players

.. code-block:: python

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

Retrieve specific player

.. code-block:: python

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

.. code-block:: python

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

Synchronize all players to specific player

.. code-block:: python

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

Synchornize all players to player streaming broadcast commentary

.. code-block:: python

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

Synchronize open players to live timing

.. code-block:: python

>>> 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_:

.. code-block:: bash

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

Then install in a virtualenv_.

.. code-block:: bash

$ pip install -e ./

Test

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

.. code-block:: bash

$ 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! 🏎️

.. _MultiViewer: https://multiviewer.app/ .. _pip: https://multiviewer.app/ .. _GitHub Repo: https://github.com/RobSpectre/mvf1 .. _virtualenv: https://multiviewer.app/ .. _Rob Spectre: https://brooklynhacker.com .. _MIT License: http://opensource.org/licenses/MIT .. _tox: https://tox.wiki/en/latest/ .. _black: https://black.readthedocs.io/en/stable/ .. _StreamDeck: https://www.elgato.com/en/welcome-to-stream-deck .. _type hints: https://docs.python.org/3/library/typing.html .. _Full documentation: https://mvf1.readthedocs.io/en/latest/ .. _Test coverage: https://app.codecov.io/gh/RobSpectre/mvf1 .. _Formula 1 TV: https://f1tv.formula1.com/

الأسئلة الشائعة

ما هو Mvf1؟

Control MultiViewer, an app for watching motorsports like Formula 1, World Endurance Championship and IndyCar.

كيف أثبّت Mvf1؟

اتبع خطوات التثبيت في توثيقه المعروض في هذه الصفحة وفي مستودعه.

هل Mvf1 مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون Mvf1؟

ينشره RobSpectre. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من القوائم المجتمعية awesome-mcp-servers ومستودع المشروع على GitHub. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.