PTB(1) General Commands Manual PTB(1)

ptbed-style peertube client

ptb [-v] [-i instance]

ptb is an interactive PeerTube client, to be used in a terminal. Created out of frustration due to the official web frontend for PeerTube requiring a modern browser with JavaScript and other degenerate anti-technology.

Command line options are as follows:

instance
Sets the current instance to specified value.
Enables debug messages.

You operate ptb by issuing commands. Commands may be shortened down to a single letter, like in ed(1).

The available commands are as follows:

cmd ... | cmd ...
Run a shell command.
[addr]browser
Open the hyperlink to a video specified by addr in a web browser, defaulting to the first if unspecified. Uses the BROWSER environment variable.
[addr]download
Download the video specified by addr to your current working directory, using the program specified by PTBDOWNLOADER.
[addr]list
List videos on the specified instance, with pagination. list behavior can be altered with set sort and nsfw options. addr specifies the page to display.
Print some debugging information.
Exit ptb. Pressing ⟨C-d⟩ does the same.
option [value]
Change settings of ptb.

Boolean options (that are either on or off) actually work similar to their vim(1) counterparts. More specifically, they may be specified without argument to be enabled, or prefixed with “no” to be disabled. From now on, for boolean options only arguments on and off will be specified.

Valid options are:

[on | off]
Toggle displaying sensitive material in list results. It's off by default due to copious amounts of porn that make search unusable. Funnily enough, the web ui of PeerTube does the same.
[on | off]
Enable or disable extra information printouts. Primarily for debugging purposes.
[criteria]
Change the order of videos in list output. Valid criteria values are: “”, “”, “”, “”, “”, “”, “”, and “”. Any of them may be immediately prefixed with a dash (‘-’) to reverse the order, like “-duration” to put the longest videos first. See https://docs.joinpeertube.org/ for what the names actually mean.

If criteria is unspecified, reverts to the default of “-best”.

url
Set the PeerTube instance used by for list, yank, browser and watch commands. Defaults to “xxivproduction.video”.
Toggle verbose option.
[addr]yank
Copies the hyperlink to a video specified by addr, defaulting to 1 if unspecified. Takes the program to use for clipboard operations from PTBCOPYPROG environment variable, see below for defaults.
[addr]watch
Streams the video specified by addr in a media player, using the program specified by PTBPLAYER.

ptb also accepts editline(7) commands.

Browser program. Invoked when running the browser command. Defaults to firefox(1).
Video player that is called upon running the watch command. If unset, defaults to mpv(1).
Program called when executing the yank command. Must be able to take input from stdin. If not explicitly set, defaults to “xsel -ib”.
Same as previous entry, called when d command is used. Defaults to yt-dlp.

As ptb uses libcurl for network operations, it also accepts the same environment variables as libcurl. They are documented separately in libcurl-env(3).

ed(1), mpv(1), yt-dlp(1), libcurl-env(3)

ptb was modelled after peertube-viewer-rs and ed(1). It was first written in Korn shell, later rewritten in C.

Sosthène Guédon <dev@peertube-viewer.com> made peertube-viewer-rs, and
Stepan Zolotuev <poopenfarten@dismail.de> reimplemented a subset of it in C.

All software has.

November 2, 2024 OpenBSD 7.6