

Github GitHub - SoMuchForSubtlety/f1viewer: 🏎️ TUI for F1TV
source link: https://github.com/SoMuchForSubtlety/f1viewer
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

f1viewer
Table of Contents
Installation
Note: You also need a compatible player installed, you can find a list here.
Windows
macOS
- You can install f1viewer with Homebrew (recommended)
brew tap SoMuchForSubtlety/tap brew install SoMuchForSubtlety/tap/f1viewer
- Or download the binary directly
Debian and Ubuntu
Download the latest release .deb
file and install it.
Fedora
Install from the f1viewer copr repository
sudo dnf copr enable somuchforsubtlety/f1viewer sudo dnf install f1viewer
openSUSE
Download the latest release .rpm
file and install it.
Install the f1viewer AUR package.
Any other Linux distribution
- Download the binary directly
- Install it with Homebrew as described in the macOS section.
- build it from source
go get github.com/SoMuchForSubtlety/f1viewer
why is there a login, what credentials should I use
You need an F1TV account created with an IP in a country that has F1TV pro. Use your F1TV account email and password to log in. You can use the tab key to navigate the login form.
when I try to play something I get a 4xx error
You need to be logged in and in a country that has F1TV pro. If you get the error but think your account should be able to play the selected content please open an issue.
f1viewer is not showing a live session / loading very slowly
This can happen if the F1TV servers are overloaded. There is nothing I can do to fix this. Start your stream as soon as possible at the start of the session and you can usually avoid this.
The player starts but then has some issue / error
Please make sure you are using the latest version of the player. If you use Windows please download MPV from here. Generally once an external program is started f1viewer is done and you should consult the external program's documentation for troubleshooting.
No players are detected
Players need to be in your PATH environment variable to be detected by f1viewer.
Config
When you first start f1viewer a boilerplate config is automatically generated. On Widows systems it's located in %AppData%\Roaming\f1viewer
, on macOS in $HOME/Library/Application Support/f1viewer
and on Linux in $XDG_CONFIG_HOME/f1viewer
or $HOME/.config/f1viewer
. You can access it quickly by running f1viewer -config
.
The default config looks like this
{ "live_retry_timeout": 60, "preferred_language": "en", "check_updates": true, "save_logs": true, "log_location": "", "custom_playback_options": [], "multi_commands": [], "horizontal_layout": false, "tree_ratio": 1, "output_ratio": 1, "terminal_wrap": true, "disable_team_colors": false, "theme": { "background_color": "", "border_color": "", "category_node_color": "", "folder_node_color": "", "item_node_color": "", "action_node_color": "", "loading_color": "", "live_color": "", "update_color": "", "no_content_color": "", "info_color": "", "error_color": "", "terminal_accent_color": "", "terminal_text_color": "" } }
live_retry_timeout
is the interval f1viewer looks for a live F1TV session secondspreferred_language
is the language MPV is started with, so the correct audio track gets selectedcheck_updates
determines if F1TV should check GitHub for new versionssave_logs
determines if logs should be savedlog_location
can be used to set a custom log output foldercustom_playback_options
can be used to set custom commands, see Custom Commands for more infomulti_commands
can be used to load a set of feeds automatically, see Multi Commands for more infohorizontal_layout
can be used to switch the orientation from vertical to horizontaltheme
can be used to set custom colors for various UI elements. Please use standard hex RGB values in the format#FFFFFF
orFFFFFF
.tree_ratio
andoutput_ratio
can adjust the UI ratio. The values need to be integers >= 1.terminal_wrap
toggles line wrap for the terminal window. Default is valuetrue
disable_team_colors
disables colors for perspective selection. Default is valuefalse
Custom Commands
You can execute custom commands, for example to launch a different player. These are set in the config under custom_playback_options
. You can add as many as you want.
"custom_playback_options": [ { "title": "download with ffmpeg", "command": ["ffmpeg", "-i", "$url", "-c", "copy", "$title.mp4"] }, { "title": "create .strm file", "command": ["echo", "$url", ">$title.strm"] } ]
title
is the title. It will appear next to the standard Play with MPV
and Copy URL to clipboard
.
command
is where your command goes. It is saved as a list of args like in the examples above. Every argument should be a separate string! The following would be incorrect! ["ffmpeg", "-i $url", "-c copy", "$title.mp4"]
There are several placeholder variables you can use that will be replaced by f1viewer.
$url
: the content's URL$category
: the content's category (eg. "Documentary")$season
: the season name (eg. "2019 Formula 1 World Championship")$event
: the event (eg. "Belgian Grand Prix")$session
: the session (eg. "F1 Practice 3")$perspective
: the perspective (eg. "Main Feed", "Kimi Räikkönen", etc.)$episode
: the name of the episode (eg. "Chasing The Dream - Episode 1")$title
: a formatted combination of$category
,$season
,$event
,$session
,$perspective
and$episode
depending on what is available for the given content. (eg. "2019 Formula 1 World Championship - Singapore Grand Prix - Race - Main Feed")$time
: the time of the session in RFC3339 format ($year
,$month
,$day
,$hour
and$minute
are also available)$date
: the date of the session in ISO 8601 format$ordinal
: the ordinal numer of the event
Note: $title
has illegal characters removed so it can be used as a filename, the other variables are left unmodified.
If you have ideas for more variables feel free to open an issue.
Tip: To get Windows commands like echo
, dir
, etc. to work, you'll need to prepend them with "cmd", "/C"
, so for example ["echo", "hello"]
turns into ["cmd", "/C", "echo", "hello"]
Multi Commands
To make it easy to load the same feeds with the same commands every time, you can map multiple commands to one action. The match_title
variable will be used to match the session feeds (it also allows regex). For example, if match_title
is Lando Norris
, it will load any feed with that name, with the given command.
You can specify commands directly with command
, or reference one of your custom commands titles with command_key
.
For an explanation on the command
variable, see Custom Commands
"multi_commands": [ { "title": "open main and pit feed", "targets": [ { "match_title": "Main Feed", "command": ["mpv", "$url"] }, { "match_title": "Pit", "command_key": "custom mpv" } ] } ]
Key Bindings
- arrow keys or
h
,j
,k
,l
. tab
to cycle through the login form fields- enter to select / confirm
q
to quit
By default f1viewer saves all info and error messages to log files. Under Windows and macOS they are save in the same directory as the config file, on Linux they are saved to $HOME/.local/share/f1viewer/
. You can access them quickly by running f1viewer -logs
.
The log folder can be changed in the config. Logs can also be turned off completely.
Credentials
Your login credentials for F1TV are not saved in the config file. On macOS they are stored in the keychain and on Windows the credential store is used. If you're using Linux, where they are saved depends on your distro. Generally Pass, Secret Service / GNOME Keyring and KWallet are supported. If it does not work on your distro or you encounter any problems please open an issue.
Recommend
-
34
Stress-Terminal UI monitoring tool
-
37
Text-based user interface (TUI) Components fptuitreemap.pas - Main component atm, attempt to draw a tree map in your terminal. See preview below for example output. ezcrt.pas - ScreenWidth,
-
11
TUI · letoram/arcan Wiki · GitHub Bjorn Stahl edited this page on Oct 1 · 7 revisions ...
-
7
F1A-TV Requirements Your AppleTV must be running tvOS 14.0 or higher Installation - TestFlight (Recommended) Go to the AppStore on your AppleTV & iPhone and search for "TestFlight" and ins...
-
7
一次对 Tui Editor XSS 的挖掘与分析 phithon 2021 八月 06 18:21 阅读:569...
-
55
sqlite-tui: A TUI for viewing sqlite databases, written in Go made with modernc.org/sqlite, charmbracelet/bubbletea, and charmbracelet/lipgloss Works with keyboard: ... And mouse! NOTE: Mouse controls don...
-
10
Trying Git TUI Clients2021-09-11Git188 words 1 min read 15 times readIf you are not accustomed to typing git commands on the command line, there are als...
-
5
a TUI playground for exploring jq.
-
9
awschult002/terminal_typist: a TUI typing game Skip to content...
-
12
andcli Load, view, decrypt and copy 2FA tokens from encrypted backup files directly in your shell. andcli uses the awesome Bubbletea library for a nice TUI. At the moment andcli can handle encrypted backups from the following provi...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK