YOUTUBE-VIEWER(1)
π NAME π
okay so welcome to youtube-viewer(1) β it's literally YouTube, but make it command line π no browser, no ads, no vibe-killing algorithm sidebar, just you and your terminal being iconic together.
youtube-viewer β YouTube from command line. that's it, that's the whole pitch π
and bestie, there's a whole help ecosystem, so peek at these whenever you're lost:
youtube-viewer --help
youtube-viewer --tricks
youtube-viewer --examples
youtube-viewer --stdin-help
π CONFIGURATION OPTIONS π
these are all the config keys, and yes there are a lot of them. don't panic. we go one by one, hand in hand π«Ά
auto_captionsβ set this to1and auto-generated captions get retrieved. by default? auto-generated captions are ignored, no cap.audio_qualityβ your preferred quality for the audio-track, and the valid values are:
best # best audio quality available (<=192kbps)
medium # medium audio quality (<=128kbps)
low # low audio quality (<=50kbps)
you can also set it to a numeric value N, which selects an audio-track with <= Nkbps β¨
autoplay_modeβ turns on autoplay mode, which will continuously play related videos. she just keeps going πbypass_age_gate_nativeβ bypasses age-restricted videos using the internal method π₯
but lowkey these streaming URLs are heavily throttled by YouTube, so manage your expectations.
when this option is disabled, a fallback method gets used instead (yt-dlp/youtube-dl or invidious instances).
bypass_age_gate_with_proxyβ bypasses age-restricted videos using a YouTube Account Proxy.cache_dirβ the cache directory, i.e. where to save temporary files.colorsβ use colors for text π yes obviously.comments_orderβ the sorting order for comments. valid values:time,relevance.confirmβ shows a confirmation message after each video played.convert_cmdβ the command used to convert videos. default value is:
"ffmpeg -i *IN* *OUT*"
*IN* gets replaced with the input file.
*OUT* gets replaced with the output file.
convert_toβ the format each downloaded video gets converted into (e.g.:mp3).cookie_fileβ load cookies from a file. super useful for overcoming that429: Too Many Requestsissue π
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) in 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. save yourself the step π
custom_layout_formatβ an array of hash values specifying a custom layout for video results, and the keys are:
align # "left" or "right"
color # any color 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 a percentage of the terminal width (e.g.: "15%").
the special tokens for text are listed in:
youtube-viewer --tricks
for better formatting, it's highly recommended to install Unicode::GCString or Text::CharWidth β¨
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_segmentedβ include or exclude streams inDynamic Adaptive Streaming over HTTP(DASH) format.debugβ enables debug/verbose mode, which prints some extra information.
valid values: 0, 1, 2, 3.
download_and_playβ play downloaded videos.download_with_wgetβ download videos withwget.download_with_ytdlβ download videos withyt-dlporyoutube-dlπ
by enabling this option and setting the value of ytdl_cmd to yt-dlp, download speed will be greatly improved. basically free speed, take it.
downloads_dirβ the directory where downloaded files go, and where converted files get saved.download_in_subdirβ downloads videos in a new subdirectory inside thedownloads_dirparent directory.
when enabled, videos get saved inside a subdirectory specified by download_in_subdir_format.
download_in_subdir_formatβ the format string used for creating that subdirectory where files get downloaded, wheneverdownload_in_subdiris enabled.
the available special tokens are listed in:
pipe-viewer --tricks
and yes, it literally sayspipe-viewerup there, notyoutube-viewerβ that's verbatim from the page, don't come for me π
env_proxyβ load proxy settings from*_proxyenvironment variables (if any).fat32safeβ when downloading a video, makes the filename compatible with the FAT32 filesystem.
additionally, if Text::Unidecode is available, then Unicode characters get converted to ASCII equivalents. cute and practical π
ffmpeg_cmdβ path to theffmpegprogram.force_fallbackβ forces the extraction of the streaming URLs to always use the fallback method (youtube-dl / invidious).fullscreenβ play videos in fullscreen mode. main character energy, obviously.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 disabling this option if the videos are lagging or dropping frames π
highlight_colorβ the highlight color used to highlight watched videos.
any color 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β the file where input history gets saved.history_limitβ the maximum number of entries in the history file.
when the limit is reached, the first half of the history file gets deleted.
set the value to -1 for no limit at all, go feral π¦
hlβ language code for categories. default:en_US.http_proxyβ sets the 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 to0, the original video gets deleted ποΈmaxResultsβ how many results to display per page.merge_into_mkvβ during download, merge the audio+video files into an MKV container.
requires ffmpeg.
merge_into_mkv_argsβ arguments forffmpegon how to merge the files.merge_with_captionsβ include closed-captions inside the MKV container (if any).orderβ the search order for videos.
valid values:
date β Sorted in reverse chronological order.
rating β Sorted from highest to lowest rating.
relevance β By relevance to the search query. (default)
title β Sorted alphabetically by title.
videoCount β Sory by number of videos (for channels).
viewCount β Sorted from highest to lowest number of views.
(that "Sory" up there is straight from the page, bestie β verbatim, I promise π)
pageβ page number of results.prefer_av1β prefer videos in AV1 format. (just for testing)prefer_mp4β prefer videos in MP4 (AVC) format.
try enabling 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.
publishedAfterβ thepublishedAfteroption indicates that the API response should only contain resources created at or after the specified time. the value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).publishedBeforeβ thepublishedBeforeoption indicates that the API response should only contain resources created before or at the specified time. the value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).regionCodeβ theregionCodeoption instructs the API to return search results for videos that can be viewed in the specified country. the parameter value is an ISO 3166-1 alpha-2 country code. (default:US)remove_played_fileβ whendownload_and_playis enabled, remove the file after playing it.resolutionβ the preferred resolution for videos.
valid values: best, 2160p, 1440p, 1080p, 720p, 480p, 360p, 240p, 144p, audio.
safeSearchβ thesafeSearchoption indicates whether the search results should include restricted content as well as standard content.
valid values: strict, moderate, none.
set_mtimeβ when enabled, it sets the original modification date of a downloaded video, using the published date of the video β¨show_video_infoβ show extra info for videos when they're 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, because non-split videos are not throttled by YouTube. althoughβ¦ the highest resolution of non-split videos is 360p. pick your fighter π
srt_languagesβ list of SRT languages in the order of preference.subscriptions_orderβ the sorting order for subscriptions.
valid values:
alphabetical β Sort alphabetically.
relevance β Sort by relevance.
unread β Sort by order of activity.
subscription_videos_per_channelβ how many recent videos to fetch from each channel in local subscription videos (-ls).
valid values are between 1 and 50.
thousand_separatorβ the thousands separator character for numbers>= 1000.timeoutβ the HTTPS timeout value in seconds. the default value is10seconds.user_agentβ the token that's used to identify the user agent on the network. the agent value gets sent as theUser-Agentheader in the requests.video_filename_formatβ the format string used for creating the filename of downloaded videos.
the available special tokens are listed in:
youtube-viewer --tricks
video_min_secondsβ filters out from results videos with less thanvideo_min_secondsseconds.video_player_selectedβ the selected video player, as defined in thevideo_playerstable.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
videoCaptionβ thevideoCaptionoption indicates whether the API should filter video search results based on whether they have captions.
valid values:
any β Do not filter results based on caption availability.
closedCaption β Only include videos that have captions.
none β Only include videos that do not have captions.
videoDefinitionβ thevideoDefinitionoption lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos.
valid values:
hang tight, bestie β part 2 is literally loadingβ¦ π¦
anyβ returns literally every video, no matter the resolution πhighβ only pulls the HD ones β¨standardβ only the standard-definition girlies π
videoDimension
Okay so videoDimension is your 3D-or-not filter for searches. It's giving "I only want flat videos" or "give me the depth, bestie."
The valid values are:
2dβ restricts results so 3D videos are excluded entirely.3dβ restricts results so only 3D videos show up. main character 3D energy πanyβ includes both the 3D and the non-3D videos in the results.
videoDuration
The videoDuration parameter filters your video search results by how long the videos are. Very "I have 4 minutes before class" of it, honestly.
Valid values: any, short, long. (And then the page lists the full menu again, iconic of it π β here's the whole thing:)
anyβ does not filter your search results by duration at all.longβ only includes videos longer than 20 minutes.mediumβ only includes videos that are between 4-20 minutes.shortβ only includes videos that are less than 4 minutes long.
videoLicense
videoLicense filters your search results so you only get videos rockin' a particular license.
The valid values:
anyβ all the videos, no matter which license they're carrying.creativeCommonβ only returns videos with a "Creative Commons" license π«Άyoutubeβ only returns videos with the standard YouTube license.
videoSyndicated
videoSyndicated lets you restrict a search to only the videos that can actually be played outside of youtube.com. So like, the ones allowed to travel π¦
Valid values:
anyβ returns all videos, syndicated or not.trueβ only retrieves the syndicated ones.
watch_history
Remember the videos you've watched across multiple sessions. Memory queen behavior π§ β¨
The video IDs get saved in the filename you specify with watch_history_file.
Heads up bestie: this option is also required for --watched-videos. No history, no watched-videos list, that's the deal π
watch_history_file
The file where the video IDs of your watched/downloaded videos get saved, but only when watch_history is set to a true value. It's the lil storage spot for your receipts π
wget_cmd
The command that gets used for wget, but only when download_with_wget is set to a true value.
youtube_users_file
Path to a list of YouTube channels, using this format:
ChannelID NAME
And you can list those channels with the command-line option -fc π
youtube_video_url
The format for sprintf() used for constructing a YouTube video URL given the video ID. It's the lil URL blueprint, iykyk π
ytdl
Use youtube-dl for videos with encrypted signatures.
When it's set to 0, invidious instances get used instead. Two totally different vibes, pick your fighter β¨
ytdl_cmd
The command for yt-dlp or youtube-dl when ytdl is set to a true value.
π CONFIGURATION FILES π
The configuration files are:
~/.config/youtube-viewer/youtube-viewer.conf
~/.config/youtube-viewer/gtk-youtube-viewer.conf
π YOUTUBE API REFERENCE π
https://developers.google.com/youtube/v3/docs/
π¦ REPOSITORY π¦
https://github.com/trizen/youtube-viewer
π LICENSE AND COPYRIGHT π
Copyright 2010-2025 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.
See <https://dev.perl.org/licenses/> for more information.
And that's the whole page, bestie, we ate that ππ Quick sign-off for the record: this beauty's running on perl v5.42.2, dated 2026-02-15, and it's page YOUTUBE-VIEWER(1) β periodt π β¨
π¦ where this page comes from
- alpine 3.24: youtube-viewer-doc 3.11.6-r1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms