Configuration
The config file for peertube-viewer-rs can be placed
Platform | Location |
---|---|
Linux | $XDG_CONFIG_HOME/peertube-viewer-rs/config.toml or $HOME /.config/peertube-viewer-rs/config.toml |
macOS | $HOME /Library/Preferences/peertube-viewer-rs/config.toml |
Windows | {FOLDERID_RoamingAppData}\peertube-viewer-rs\config.toml |
Syntax
The config file is written in TOML
An example of config file with all configuration option showed is available lower or can be obtained with peertube-viewer-rs --print-full-example-config
Format
-
nsfw
behavior for nsfw contentcolors
coloring of the outputselect-quality
regarding quality selectionedit-mode
to set the input mode to vi style keybindingsbrowser
set the browser to be useduser-agent
set the user agent to be used
-
command
video player commandargs
video player argumentsuse-raw-urls
see command line argumentsprefer-hls
prefer hls streams to static files
-
search-engine
search engine to be usedmain
main instance to browseblocklist
instance blocklistallowlist
instance blocklist
General
Configuration for peertube-viewer-rs general behavior
nsfw
Set the behavior for nsfw content. It can be:
"block"
: block all nsfw content"tag"
: the default, add a red nsfw tag next to the video"let"
: treat nsfw content the same
This relies on the videos being properly tagged by the instance.
colors
Set whether output should be colored options:
"enable"
: the default"disable"
select-quality
Set whether the --select-quality
flag is enabled by default
true
false
: the default
edit-mode
Set the editing mode. This allows the use of either vi or emacs keybinds. If you don't know what it is you don't need to worry about this option.
"emacs"
: the default"vi"
browser
Set the browser to use when opening items with the :browser
command.
If this variable isn't set, the BROWSER
environment variable is used.
If the environment variable isn't available, Firefox is the default
user-agent
Set the User-Agent
string to be used when making http requests.
If can be a string, which will be used as is, or a boolean (false means remove the User-Agent
header).
Defaults to: peertube-viewer-rs/<version>
Example:
[general]
nsfw = "block"
colors = "enable"
select-quality = true
edit-mode = "vi"
browser = "qutebrowser"
user-agent = false
Player
Configuration for the player
The videos are played with the command: player <player-args> <url>
.
command
Sets the command for the player, it is expected to be a string
args
Sets the arguments for the player, it is expected to be an array of strings
use-raw-urls
Set whether the --use-raw-urls
flag is enabled by default
true
false
: the default
prefer-hls
Peertube has support for live streaming. Some regular videos are also made available through hls.
This settings tells peertube-viewer
which one it should prefer if both are available.
false
true
: the default
Note: this option doesn't do anything if either select-quality
is true
or if use-raw-urls
is false
Example:
[player]
command = "vlc"
args = ["--no-audio", "-f"]
use-raw-urls = true
prefer-hls = false
Torrent
Sets the command for the torrent downloader, it is expected to be a string
args
Sets the arguments for the torrent downloader, it is expected to be an array of strings
Example:
[player]
command = "transmission-remote"
args = ["-a"]
instances
Instance settings
search-engine
The search engine to be used (sepiasearch.org is the default)
main
The main instance to be connected to, it is expected to be a string.
It is incompatible with the search-engine
option. The difference with the search engine option is that all API requests will be made through the same instance.
blocklist-allowlist
blocklist
: an array of strings of instances to be blockedallowlist
: an array of strings of instances to be allowed
Both can't be present at the same time. When blocklist is present, no video from the instances listed will be shown. When allowlist is present, only videos from the instances listed will be shown.
Full configuration
This is an example of all configuration options that can be set
[general]
# available options: block, tag(add a nswf tag to search results), let(do nothing)
# default is tag
nsfw = "block"
# enable or disable, defaults to enable
colors = "disable"
# can be true or false
select-quality = true
# can be emacs or vi, defaults to emacs
edit-mode = "vi"
# If this option isn't present, the "BROWSER" environment variable is used
# If it isn't set, the default is Firefox
browser = "qutebrowser"
# Change the User-Agent used for requests
# Defaults to peertube-viewer-rs/<verion>
# false instead of a string removes the user agent
user-agent = "Mozilla/5.0 (X11; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0"
[player]
command = "mpv"
args = ["--volume=30"]
# can be true or false
use-raw-urls = true
# can be true or false
# When use-raw-urls is true and this is true, peertube-viewer will prioritize hls
# versions of videos instead of the static files for a given resolution
# This option is overrided to false when select-quality is given
prefer-hls = false
[instances]
main = "skeptikon.fr"
# peertube-viewer supports using sepiasearch
# search-engine = "sepiasearch.org"
# allowlist = ["video.ploud.fr"]
blocklist = ["peertube.social"]
[torrent]
command = "transmission-remote"
args = ["-a"]