PIPE-VIEWER(1)

๐Ÿ“ฆ
version 0.5.3 ยท 3 versions
, in alpine 3.24

๐ŸŽ€ NAME ๐ŸŽ€

Okay so this is the PIPE-VIEWER(1) page โ€” yes, from the User Contributed Perl Documentation โ€” and it's literally pipe-viewer: YouTube from command line. Bestie, it's giving terminal main character energy. ๐Ÿ’…

Run these when you need the lore:

pipe-viewer --help
pipe-viewer --tricks
pipe-viewer --examples
pipe-viewer --stdin-help

๐ŸŒธ CONFIGURATION OPTIONS ๐ŸŒธ

api_host ๐ŸŒ

Hostname of an invidious instance. When it's set to auto, a random invidious instance gets picked on-demand. Slay, spontaneous.

List of public invidious instances:

https://api.invidious.io/

Tor instances are also supported if the socks5://127.0.0.1:9050 Tor proxy is available and the Perl module LWP::Protocol::socks is installed. iykyk.

auto_captions ๐ŸŽ€

When set to 1, auto-generated captions will be retrieved. By default, auto-generated captions are ignored. Lowkey respectful of your bandwidth.

audio_quality ๐ŸŽง

The preferred quality for the audio-track:

best        # best audio quality available (<=192kbps)
medium      # medium audio quality (<=128kbps)
low         # low audio quality (<=50kbps)

The option can also be set to a numeric value N in order to select an audio-track with <= Nkbps. Numbers are valid, bestie.

autoplay_mode ๐Ÿ”

Enable autoplay mode, which will continuously play related videos. It's giving "just one more video" energy.

bypass_age_gate_native ๐Ÿ”“

Bypass age-restricted videos, using our internal method.

However, these streaming URLs are heavily throttled by YouTube. No cap, they are throttled.

When this option is disabled, a fallback method will be used instead (yt-dlp/youtube-dl or invidious instances).

bypass_age_gate_with_proxy ๐Ÿ•ต๏ธ

Bypass age-restricted videos using an YouTube Account Proxy. Iconic workaround behavior.

cache_dir ๐Ÿ“

Cache directory where to save temporary files.

colors ๐ŸŒˆ

Use colors for text. Obviously iconic.

comments_order ๐Ÿ’ฌ

The sorting order for comments. Valid values: top, new.

confirm โœ…

Display a confirmation message after each video played.

convert_cmd ๐Ÿ› ๏ธ

Command to convert videos.

Default value:

"ffmpeg -i *IN* *OUT*"

*IN* gets replaced with the input file.

*OUT* gets replaced with the output file.

convert_to ๐ŸŽต

Format to convert each downloaded video into. (e.g.: mp3).

Load cookies from a file. Useful to overcome the 429: Too Many Requests issue. That error is so annoying fr fr.

The file must be a # Netscape HTTP Cookie File. Same format as youtube-dl requires.

See also:

https://github.com/ytdl-org/youtube-dl#how-do-i-pass-cookies-to-youtube-dl

copy_caption ๐Ÿ“

When downloading a video, copy the closed-caption (if any) into the same folder with the video.

If merge_into_mkv and merge_with_captions are both enabled, there is no need to enable this option. Efficiency ate.

custom_layout_format ๐ŸŽจ

An array of hash values specifying a custom layout for video results.

align       # "left" or "right"
color       # any color name supported by Term::ANSIColor
text        # the actual text
width       # width allocated for the text

The value for width can be either a number of characters (e.g.: 20) or can be a percentage of the terminal width (e.g.: "15%").

The special tokens for text are listed in:

pipe-viewer --tricks

For better formatting, it's highly recommended to install Unicode::GCString or Text::CharWidth. Do it for the aesthetic.

custom_channel_layout_format ๐Ÿ“บ

An array of hash values specifying a custom layout for channel results.

custom_playlist_layout_format ๐ŸŽผ

An array of hash values specifying a custom layout for playlist results.

dash ๐ŸŽš๏ธ

Include or exclude streams in "Dynamic Adaptive Streaming over HTTP" (DASH) format.

date ๐Ÿ“…

Search for videos uploaded within a specific amount of time.

Valid values: anytime, hour, today, week, month, year.

debug ๐Ÿ›

Enable debug/verbose mode, which will print some extra information.

Valid values: 0, 1, 2, 3.

downloads_dir ๐Ÿ’พ

Directory where to download files and where to save converted files.

download_and_play โ–ถ๏ธ

Play downloaded videos.

download_with_wget ๐Ÿ“ฅ

Download videos with wget.

download_with_ytdl โฌ‡๏ธ

Download videos with yt-dlp or youtube-dl.

By enabling this option and setting the value of ytdl_cmd to yt-dlp, download speed will be greatly improved. Speed upgrade, bestie.

env_proxy ๐ŸŒ

Load proxy settings from *_proxy environment variables (if any).

fat32safe ๐Ÿงƒ

When downloading a video, make the filename compatible with the FAT32 filesystem.

Additionally, if Text::Unidecode is available, then Unicode characters are converted to ASCII equivalents. Compatibility slay.

features ๐Ÿท๏ธ

A list of video features, return only videos with the specified features:

live               # Live stream
4k                 # 4K resolution
hd                 # HD resolution (>=720p)
subtitles          # Video has subtitles/closed-captions
creative_commons   # Creative Commons license
360                # 360ยฐ field of view
vr180              # Stereoscopic widh a 180ยฐ field of view
3d                 # 3D
hdr                # High dynamic range

ffmpeg_cmd ๐ŸŽฌ

Path to the ffmpeg program.

force_fallback ๐Ÿช‚

Force the extraction of the streaming URLs to always use the fallback method (youtube-dl / invidious).

fullscreen ๐Ÿ–ฅ๏ธ

Play videos in fullscreen mode.

get_captions ๐Ÿ’ฌ

Download closed-captions for videos (if any).

get_term_width ๐Ÿ“

Read the terminal width (stty size).

hfr ๐ŸŽž๏ธ

Prefer or ignore High Frame Rate (HFR) video streams.

Try to disable this option if the videos are lagging or dropping frames. Lag is not the vibe.

highlight_color ๐Ÿ–๏ธ

Highlight color used to highlight watched videos.

Any color name supported by Term::ANSIColor can be used.

highlight_watched ๐Ÿ‘€

Highlight watched videos.

history ๐Ÿ•ฐ๏ธ

Enable or disable support for input history.

Requires Term::ReadLine::Gnu.

history_file ๐Ÿ“œ

File where to save the input history.

history_limit ๐Ÿ”ข

Maximum number of entries in the history file.

When the limit is reached, the oldest half of the history file will be deleted.

For no limit, set the value to -1.

http_proxy ๐Ÿงฆ

Set HTTP(S)/SOCKS proxy, using the format:

'proto://domain.tld:port/'

If authentication is required, use:

'proto://user:pass@domain.tld:port/'

For example, to use Tor, install LWP::Protocol::socks and set this value to:

"socks://127.0.0.1:9050"

ignore_av1 ๐Ÿšซ

Ignore videos in AV1 format.

ignored_projections ๐Ÿ“

An array of video projections to ignore.

For example, to prefer rectangular projections of 360ยฐ videos, use:

ignored_projections => ["mesh", "equirectangular"],

interactive ๐Ÿซถ

Interactive mode, prompting for user-input.

keep_original_video ๐Ÿ—‚๏ธ

Keep the original video after conversion. When set to 0, the original video will be deleted. Bestie, it's gone-gone.

local_playlist_limit ๐ŸŽš๏ธ

When set to a positive value, will restrict the size of the local playlists to this many entries. When this limit has been reached, older entries will be discarded from the playlist.

A reasonable value would be between 500 and 1000.

For no limit, set the value to -1.

maxResults ๐Ÿ”Ž

How many results to display per page.

Currently, this is not implemented. Not me waiting for this feature.

merge_into_mkv ๐Ÿงฉ

When downloading split videos, merge the audio+video files into an MKV container.

Requires ffmpeg.

merge_into_mkv_args โš™๏ธ

Arguments for ffmpeg how to merge the files.

merge_with_captions ๐Ÿ’ฌ

Include closed-captions inside the MKV container (if any).

order ๐Ÿงญ

Search order for videos.

Valid values: relevance, rating, upload_date, view_count.

page ๐Ÿ“„

Page number of results.

prefer_av1 ๐Ÿงช

Prefer videos in AV1 format. (experimental)

prefer_mp4 ๐ŸŽฅ

Prefer videos in MP4 (AVC) format.

Try to enable this option if the videos are lagging or dropping frames.

prefer_m4a ๐ŸŽง

Prefer audio streams in M4A (AAC) format.

By default, the OPUS format for audio is preferred.

prefer_invidious ๐Ÿธ

Prefer invidious instances over parsing the YouTube website directly.

region ๐ŸŒŽ

ISO 3166 country code (default: US).

remove_played_file ๐Ÿงน

When download_and_play is enabled, remove the file after playing it.

resolution ๐Ÿ“บ

Preferred resolution for videos.

Valid values: best, 2160p, 1440p, 1080p, 720p, 480p, 360p, 240p, 144p, audio.

show_video_info โ„น๏ธ

Show extra info for videos when selected.

skip_if_exists โœ…

When downloading, skip if the file already exists locally.

skip_watched โญ๏ธ

Skip already watched/downloaded videos.

split_videos โœ‚๏ธ

Enable or disable support for split-videos. Split-videos are videos that do not include audio and video in the same file.

Disable this option if the videos are loading too slowly, as non-split videos are not throttled by YouTube. Although, the highest resolution of non-split videos is 360p. Trade-offs, bestie.

srt_languages ๐Ÿ—ฃ๏ธ

List of SRT languages in the order of preference.

saved_channels_file ๐Ÿ’–

Absolute path to the file where to store saved channels (:save=i).

subscribed_channels_file ๐Ÿ””

Absolute path to the file where to store subscribed channels (:sub=i).

subscription_results ๐Ÿ“ฌ

Comma-separated list of methods used to retrieve videos from subscribed channels.

subscription_results => "uploads,streams",   # include streams in feed

Valid values: uploads, streams, shorts.

subscriptions_lifetime โณ

Amount of time, in seconds, before rescanning the subscribed channels for new videos (during -ls).

subscriptions_limit ๐Ÿ—ƒ๏ธ

Maximum number of subscription videos to store in the local database. Set to 0 for no limit.

thousand_separator ๐Ÿ”ข

Thousands separator character for numbers >= 1000.

timeout โฑ๏ธ

HTTPS timeout value in seconds. The default value is 10 seconds.

user_agent ๐Ÿชช

Token that is used to identify the user agent on the network. The agent value is sent as the User-Agent header in the requests.

video_filename_format ๐Ÿท๏ธ

The format of filename for downloaded files.

The available special tokens are listed in:

pipe-viewer --tricks

video_player_selected ๐ŸŽฎ

The selected video player defined in the video_players table.

video_players ๐Ÿ•น๏ธ

A table of video players.

The keys for each player are:

arg        # any arguments for the video player
audio      # option specifying the *AUDIO* file
cmd        # the main player command
fs         # the fullscreen option
novideo    # the no-video mode option
srt        # option specifying the *SUB* file

videoDuration โฒ๏ธ

Retrieve only short or long videos in search results.

Valid values: any, short (under 4 minutes), average (4-20 minutes), and long (over 20 minutes).

watch_history ๐Ÿ“š

Set to 1 to remember and highlight watched videos across multiple sessions.

Watched videos can be listed with:

pipe-viewer -wv

The video IDs are saved in the filename specified by watch_history_file.

watch_history_file ๐Ÿ—„๏ธ

File where to save the video IDs of watched/downloaded videos when watch_history is set to a true value.

wget_cmd ๐Ÿ“ก

Command for wget when download_with_wget is set to a true value.

  • youtube_video_url โ€” the sprintf() format string used to build a YouTube video URL from a video ID ๐ŸŽฌ
  • youtube_channel_url โ€” same deal, but for a channel URL from a channel ID ๐Ÿ“บ
  • youtube_playlist_url โ€” and again for a playlist URL from a playlist ID ๐ŸŽถ
  • ytdl โ€” set this to use youtube-dl for videos with encrypted signatures ๐Ÿ”

When it's 0, invidious instances get used instead. (Bestie, that's the whole vibe: 1 = ytdl does the work, 0 = invidious steps in.)

  • ytdl_cmd โ€” the command for yt-dlp or youtube-dl when ytdl is set to 1 ๐Ÿ’ป

It's also the command for yt-dlp when it's pulling YouTube comments and ytdlp_comments is 1. One command, two jobs, main character energy.

  • ytdlp_comments โ€” when this is 1, yt-dlp handles extracting YouTube comments โœจ (it's experimental, so like... enjoy but don't @ me)

When it's 0, invidious instances are used instead.

  • ytdlp_max_comments โ€” the maximum number of comments yt-dlp will extract ๐Ÿ”ข

Heads up: replies count as comments too, so budget accordingly.

  • ytdlp_max_replies โ€” the max number of replies per thread ๐Ÿ’ฌ

Set it to 0 to disable replies entirely (no replies, no drama).

Set it to "all" to extract literally all the replies ๐Ÿ‘€


๐Ÿ—‚๏ธ CONFIGURATION FILES

The configuration files are, and I quote:

~/.config/pipe-viewer/pipe-viewer.conf
~/.config/pipe-viewer/gtk-pipe-viewer.conf

That's where the vibes live, bestie ๐Ÿ’–


๐Ÿ”Œ INVIDIOUS API REFERENCE

https://github.com/iv-org/invidious/wiki/API

iykyk โ€” that's the API docs right there ๐Ÿ“š


๐ŸŒˆ REPOSITORY

https://github.com/trizen/pipe-viewer

The source. The origin story. Go star it fr fr โญ


Copyright 2010-2024 Trizen.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ๐Ÿ˜ญ (yes, that's the real legal shouting, not me being dramatic)

See <https://dev.perl.org/licenses/> for more information.


Okay that's the whole page, you made it to the end, I'm so proud of you ๐Ÿซถ๐Ÿ’œ This was PIPE-VIEWER(1), brought to you by perl v5.42.2 and dated 2024-09-28 โ€” go forth and pipe those videos, bestie, you're literally gonna slay ๐ŸŒธโœจ

๐Ÿ“ฆ where this page comes from