pipe-viewer (search and stream videos from youtube)

pipe-viewer is a lightweight application for searching and streaming
videos from YouTube. pipe-viewer is a fork of youtube-viewer that
does not require a Google API key. Usage and user interface are
identical to youtube-viewer.

For playing videos, this uses mplayer, vlc, or mpv. However, the
mplayer that ships with Slackware has some issues with pipe-viewer
(or actually with youtube: the audio stream cuts out randomly, and
can be fixed by pressing the left arrow usually).

Optional dependencies:

vlc and/or mpv - for playing videos. highly recommended.
perl-Gtk3, perl-File-ShareDir - for gtk-pipe-viewer.
perl-lwp-useragent-cached - for local cache support.
perl-JSON-XS - for faster JSON deserialization.
perl-Text-CharWidth, perl-Unicode-LineBreak - for better formatting
                                              in the terminal.

Counting optional ones, pipe-viewer has over 40 dependencies. To make
life easier, there's a "pipe-viewer.sqf" queue file included with this
build, which includes everything listed above (except mpv and vlc).

This build always includes the command-line client (pipe-viewer). For
the GTK client (gtk-pipe-viewer[1]), install perl-Gtk3 and
perl-File-ShareDir before running this script. If you have them
installed but don't want gtk-pipe-viewer, you can set GTK=no in the
script's environment.

Notes:

[1] To force gtk-pipe-viewer to use your preferred terminal for
    downloading with wget and watching in a terminal, set
    TERMINAL in the script's environment (e.g. TERMINAL="xterm" or
    TERMINAL="urxvt").
