Skip to main content

A Python package to control video players for MultiViewer for F1, the best way to watch Formula 1.

Project description

A Python package and command line interface to control video players for MultiViewer For F1, 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

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

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 For F1 or Formula 1 TV.

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

  • 🏎️ ¡Vamos Checo! 🏎️

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

mvf1-1.1.2.tar.gz (15.8 kB view hashes)

Uploaded Source

Built Distribution

mvf1-1.1.2-py3-none-any.whl (16.0 kB view hashes)

Uploaded Python 3

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