Skip to content
This repository was archived by the owner on Feb 10, 2023. It is now read-only.

Commit 92f4a74

Browse files
add custom commands to readme
1 parent 8022937 commit 92f4a74

File tree

1 file changed

+40
-11
lines changed

1 file changed

+40
-11
lines changed

README.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1+
2+
13
## F1Viewer
24

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

57
Now also supports live streams.
68

7-
![screenshot](https://i.imgur.com/K8yCkib.png)
9+
![alt text](https://i.imgur.com/K8yCkib.png)
810

11+
912
### USAGE
1013

11-
1. **Install F1Viewer**
14+
1. **install F1Viewer**
1215

1316
build it yourself
1417

@@ -21,28 +24,54 @@ Now also supports live streams.
2124
2225
**or**
2326

24-
download [pre-compiled binaries](https://github.com/SoMuchForSubtlety/F1viewer/releases/)
25-
27+
or download pre-compiled binaries
28+
https://github.com/SoMuchForSubtlety/F1viewer/releases/
2629

2730
2. **Download MPV**
2831

29-
Download it from [here](https://mpv.io/installation/) (Windows users please get the latest version from [here](https://sourceforge.net/projects/mpv-player-windows/files/)) and either put it in the same folder as the F1Viewer binary or add it to your PATH environment variable.
32+
Download it from [here](https://mpv.io/installation/) and either put it in the same folder as the F1Viewer binary or add it to your PATH environment variable.
33+
34+
35+
3036

3137
### FLAGS
3238

3339
-d
3440
shows debug information
3541

36-
-vlc
37-
enables the VLC http stream option, requires a config with the correct parameters set.
38-
3942
### CONFIG
40-
The config is optional. It is used to set a preferred audio language and VLC streaming credentials.
43+
The config is is optional. It is used to set a preferred audio language and custom commands.
4144
The sample config looks like this.
4245

4346
{
4447
"preferred_language": "en",
45-
"vlc_telnet_port": "4212",
46-
"vlc_telnet_pass": "admin"
48+
"custom_playback_options": [
49+
{
50+
"title": "Play with MPV custom",
51+
"commands": [
52+
["mpv", "$url", "--alang=de"]
53+
],
54+
"watchphrase": "Video",
55+
"command_to_watch": 0
56+
}
57+
]
4758
}
59+
4860
Save it as `config.json` in the same Folder as the F1Viewer binary
61+
62+
### CUSTOM COMMANDS
63+
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.
64+
65+
`title` is the title. It will appear next to the standard `Play with MPV` and `Download .m3u8`.
66+
67+
`commands` is where your custom command goes. There can be one or more.
68+
Commands are saved as a list of args, like `["mpv", "$url", "--alang=de"]`.
69+
`$url` will be replaced with the correct playback URL.
70+
71+
`watchphrase` is optional. it is used to play a `loading...` animation.
72+
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.
73+
74+
`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`.
75+
76+
If `command_to_watch` is out of range or `watchphrase` is an empty string, the loading animation will be skipped.
77+

0 commit comments

Comments
 (0)