f1viewer

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2019 License: LGPL-3.0 Imports: 19 Imported by: 0

README

F1Viewer

Stream any F1TV VOD with MPV or download the corresponding .m3u8 file.

Now also supports live streams.

alt text

USAGE

  1. install F1Viewer

    build it yourself

    $ git clone https://github.com/SoMuchForSubtlety/F1viewer/
    $ cd F1Viewer
    $ cp sample-config.json config.json
    $ go get github.com/rivo/tview
    $ go build
    

    or

    or download pre-compiled binaries https://github.com/SoMuchForSubtlety/F1viewer/releases/

  2. Download MPV

    Download it from here and either put it in the same folder as the F1Viewer binary or add it to your PATH environment variable.

FLAGS

-d

shows debug information

CONFIG

The config is is optional. It is used to set a preferred audio language and custom commands. The sample config looks like this.

{
    "preferred_language": "en",
    "custom_playback_options": [
        {
            "title": "Play with MPV custom",
            "commands": [
                ["mpv", "$url", "--alang=de"]
            ],
            "watchphrase": "Video",
            "command_to_watch": 0
        }
    ]
}

Save it as config.json in the same Folder as the F1Viewer binary

CUSTOM COMMANDS

You can execute custom commands, for exaple to launch a different player. These are set in the config under custom_playback_options. You can add as many as you want.

title is the title. It will appear next to the standard Play with MPV and Download .m3u8.

commands is where your custom command goes. There can be one or more. Commands are saved as a list of args, like ["mpv", "$url", "--alang=de"]. $url will be replaced with the correct playback URL.

watchphrase is optional. it is used to play a loading... animation. F1Viewer can parse the output of your command and stop the animation once the watchphrase is found. This can be useful if your command takes a while to execute.

command_to_watch belongs to watchphrase. It defines what command to parse if there are multiple. It is indexed at 0 so if you only have 1 command, command_to_watch should be 0.

If command_to_watch is out of range or watchphrase is an empty string, the loading animation will be skipped.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL