YTFZF(1)
π YTFZF(1) β the ytfzf manual, bestie edition π
General Commands Manual β¨ welcome to the ytfzf page, we're so glad you're here π«Ά
πΈ NAME πΈ
ytfzf β search and play videos. that's it. that's the whole vibe. π
β¨ SYNOPSIS β¨
ytfzf [options] [search-query]
ytfzf [options] -
like. you give it options, you give it a search query, and it does the thing. iconic behaviour fr fr π₯
π¦ DESCRIPTION π¦
ytfzf is a POSIX script that helps you find videos from Youtube, Peertube or Odysee (no API needed, we're just built different π) and then opens/downloads them using mpv/youtube-dl.
no cap. that's the whole point of her. she's a little script with main character energy. π
π SEARCH OPERATORS π
so search operators are these special little search queries, okay? like magic words you type instead of a normal search. β¨
Standard search operators include:
:helpβ prints a possibly brief description of how to use the scraper. (possibly brief. she's not gonna write you an essay, bestie π)
Addon scrapers may have more or less search operators. so it's giving "your mileage may vary" energy π§
π SHORTCUTS π
okay so these shortcuts will apply in any menu that supports it. and the only menu that currently supports it is fzf. (she's the chosen one, iykyk π
)
the way the rules work: shortcuts starting with alt will exit the menu, and shortcuts starting with ctrl will not exit the menu. crucial distinction, don't skip it. β
to change any of the defaults, set the corresponding variable in your configuration file. (yes, the variable names are right there in the parentheses, go wild π)
- download β
alt-d(download_shortcut) - watch video β
alt-v(video_shortcut) - audio only β
alt-m(audio_shortcut) - detatch β
alt-e(detach_shortcut) (yes it's spelled "detatch" in the original and we respect her spelling choices π«Ά) - print link β
alt-l(print_link_shortcut) - show formats β
alt-f(show_formats_shortcut) - show all info β
alt-i(info_shortcut) - new search β
alt-s(search_again_shortcut) - scrape next page β
ctrl-p(next_page_action_shortcut)
π OPTIONS π
π Information
-h,--helpβ show help text. she'll tell you how to use her. π--versionβ show ytfzf's version. the numbers. the lore. π
π¬ How to play the selected videos.
okay this is the big section, hydrate before you read it. π§
-d,--downloadβ download the selected videos. this can also be set in the config file withis_download. π₯-m,--audio-onlyβ play audio only. this can also be set in the config file withis_audio_only. π§-f,--formatsβ show available formats before proceeding. like a little menu of options, very demure β¨--format-selection=screenβ the format selection screen type to use. this can also be set in the config file withformat_selection_screen.
Types:
normalsimple
--format-sort=sortβ the--format-sortto use in ytdl. this can also be set in the config file withformat_selection_sort.--video-pref=prefβ set the ytdl video format to pref. this can also be set in the config file withvideo_pref.--audio-pref=prefβ set the ytdl audio format to pref. this can also be set in the config file withaudio_pref.--ytdl-pref=prefβ set the ytdl format to pref. this can also be set in the config file withytdl_pref.--detachβ detach the video player from the terminal. this can also be set in the config file withis_detach. she's leaving the group chat to go do her own thing π¦-u,--url-handler=handlerβ the function/program to use as a url handler. this can also be set in the config file by addingload_url_handler <handler>.-I optionβ instead of playing the selected videos, get information about them in the selected format. the available options are:L|l|linkβ prints the URL of the selected videos.VJ|vj|video-jsonβ prints the json of the selected videos.J|j|jsonβ prints the json of all the videos in the search results.F|f|formatβ prints the video format being used.R|r|rawβ prints the data of the selected videos, as appears in the menu.
-Lβ alias for-I L. short queen behaviour π--info-action=Iactionβ the action to do when--info-waitis1.info_wait_action.--info-wait=numberβ whether or not to wait after printing info requested with-Ior-L. this can also be set in the config file withinfo_wait.--url-handler-opts=optsβ opts to pass to the url handler. by default this will pass extra opts tompv. this can also be set in the config file withurl_handler_opts.
π Menu options
-l,--loopβ reopen the menu when the video stops playing. this can also be set in the config file withis_loop. she's persistent. she's committed. π«-s,--search-againβ after closingfzfmake another search. this can also be set in the config file withsearch_again.-t,--show-thumbnailsβ show thumbnails. doesn't work with-Dor-H. this can also be set in the config file withshow_thumbnails.
β οΈ not me reminding you: this does NOT work with-Dor-H. she said what she said. π
--async-thumbnailsβ whether or not to download thumbnails asynchronously. downloading asynchronously will open the menu before all thumbnails are downloaded. this can also be set in the config file withasync_thumbnails.--skip-thumb-downloadβ whether or not to skip the thumbnail download. this is used if you want to not have thumbnails, or use custom thumbnails in$YTFZF_CUSTOM_THUMBNAILS_DIR.
for more info see CUSTOM THUMBNAILS in ytfzf(5).
this can also be set in the config file with skip_thumb_download.
--notify-playingβ show notifications when a video is about to be played, and other notifications relating to playing videos. this can also be set in the config file withnotify_playing. π--preview-side=sideβ the preview side infzf.
Options:
leftrightupdown
this can also be changed in the config file with fzf_preview_side.
-T,--thumb-viewer=programβ use program for displaying thumbnails.
Built-in programs:
chafa,chafa-16,chafa-ttyβchafa,chafawith 16 colors,chafawith 4 colors.catimg,catimg-256βcatimg,catimgwith 256 colors.imvβ good with tiling window managers.mpvβ similar toimv.swayimgβ only works on the sway wayland compositor.swayimg-hyprlandβ only works on the hyprland compositor. usesswayimgto render an image.<custom>β additional viewers can be put into$YTFZF_THUMBNAIL_VIEWERS_DIR.
this can also be changed in the config file by adding load_thumbnail_viewer <viewer>.
-D,--external-menuβ use an external menu instead offzf. the default isdmenu. this can also be set in the config file withinterface="ext".-i,--interface=interfaceβ use a custom interface script, which would be in$YTFZF_CUSTOM_INTERFACES_DIR. this can also be set in the config file by addingload_interface <interface>.--sortβ sorts videos (after scraping) by upload date. this can also be set in the config file by addingis_sort. π--sort-name=nameβ calls a function set in$YTFZF_CONFIG_FILE. or sources a script in$YTFZF_SORT_NAMES_DIR(if it exists). see SORT NAMES inytfzf(5)for more information.--fancy-subsβ whether or not to have a separator between each subscription. when this option is used it automatically disables--sortas it will mess up this option. this can also be set in the config file withfancy_subs.
β οΈ fr fr, using this turns off --sort for you. they do not coexist. periodt. π
--disable-backβ whether or not to disable the back button in submenus. this can also be set in the config file withenable_back_button.--disable-actionsβ whether or not to disable actions such as submenus and the back button. this can also be set in the config file withenable_actions.--disable-submenusβ whether or not to disable submenus. submenus are the menus that happen after a playlist or channel (currently only supported by youtube/invidious) is selected. this can also be set in the config file withenable_submenus.--keep-varsβ whether or not options passed intoytfzfalso get passed into submenus. this can also be set in the config file withkeep_vars.--submenu-opts=optsβ the opts to use in the submenu. this can also be set in the config file withsubmenu_opts.--submenu-scraping-opts=optsβ DEPRECATED (use--submenu-optsinstead). does the same thing as--submenu-opts. this can also be set in the config file withsubmenu_scraping_opts.
π she's deprecated bestie, don't build your whole personality on her. use --submenu-opts.
π― Auto selecting
-a,--auto-selectβ auto-play the first result. no thinking required, she's got it π«Ά-A,--select-allβ select all results. all of them. every single one. π-r,--random-selectβ auto-play a random result. chaos mode activated π²-S sed address,--select=sed addressβ auto-play a specific video.
Examples:
2 Select the second video
$ Select the last video
/^h/ Select all videos starting with h
-n number,--link-count=numberβ the number of videos to select with-aor-r.
πΈοΈ Scrapers
-c scrapers,--scrape=scrapersβ set which scraper to use. multiple scrapers can be separated by comma (,). the currently supported builtin scrapers are:youtube|Yβ scrapes invidious' api with a search query.youtube-channelβ scrapes a youtube channel with youtube.invidious-channelβ scrapes a youtube channel with$invidious_instance. when this scrape is active the search query is the link to a channel.
(part 1 of 3 β more coming, don't go anywhere bestie π¦)
video-recommended,Rβ scrapes the recommended videos off an invidious video link β¨youtube-playlist,invidious-playlistβ scrapes a youtube playlist. When this scrape is the one active, your search query is the link to the playlist, periodt.youtube-trending,Tβ scrapes invidious' api to grab youtube trending π. When this scrape is active, your search query is the tab of trending you wanna scrape.from-cacheβ scrapes a previous scrape that happened using--keep-cache, pulling it back out of the saved cache π«ΆM,multiβ uses ytfzf recursively to scrape a bunch of things with a bunch of different options at once. Seeytfzf -c M :helpfor more info, bestie. Tabs:- gaming
- music
- movies
youtube-subscriptions,S,SIβSIscrapes invidious for channels instead of youtube. Scraping youtube directly may result in rate limiting π so like, be aware.scrape-list,SLβ uses your$YTFZF_SCRAPELIST_FILEas the scrape and search input. See "scrape lists" inytfzf(5)for the full tea.peertube,Podysee,lbry,Ohistory,Hβ (only if$enable_histis enabled)url,Uβ opens the url in the video player and exits. bye πuβ treats the url as an item, and will open fzf, or the external menu.commentsβ scrapes the comments of a video link from youtube π¬
-H,--historyβ alias for-c H. Scrapes the history file.--scrape+=scrapersβ same as-c, but keeps the default scrape as well (so you're adding, not replacing, queen π ).--scraper-=scrapersβ removes a scraper from the list of scrapers to use.--multi-searchβ whether or not to use multi search. To use multi search, separate each search with a comma β this works so well when you're using multiple scrapers. This can also be set in the config file withmulti_search.--force-youtubeβ when using the youtube scraper, convert the invidious links to youtube links before playing/downloading.--force-invidiousβ when using the youtube scraper, use whatever invidious instance was chosen instead of converting to youtube links.
π Scraper Options π
Heads up bestie: currently, --video-duration, --type, --thumbnail-quality, and --features only apply to the scrape youtube/Y. iykyk.
--pages=amountβ the amount of pages to scrape on youtube/invidious, and for the comments scraper. This can also be set in the config file withpages_to_scrape.--pages-start=pageβ the page to start on. This can also be set in the config file withpages_start.--max-threads=amountβ the amount of threads that can be used to scrape youtube search, playlists, and channels. (this does not apply to the subscription scraper). This can also be set in the config file withmax_thread_count.--single-threadedβ sets themax_thread_countto1, which has the same effect as making everything single threaded. (this does not apply to the subscription scraper). This can also be set in the config file withmax_thread_count=1.--odysee-video-count=amountβ the amount of videos to scrape on odysee. This can also be set in the config file withodysee_video_search_count.--nsfwβ whether or not to search for nsfw videos π. Only works withodysee/O. This can also be set in the config file withnsfw.--sort-by=sortβ works withyoutube/Yandodysee/O. To use a different sort for each scrape, use a comma (,) to separate the sorts. As opposed to--sort, this happens during the search, not after. Results should sort by:- relevance
- rating (youtube only)
- upload_date
- oldest_first (odysee only)
- view_count (youtube only)
--upload-date=time-frameβ works withyoutube/Yandodysee/O. To use a different date for each scrape, use a comma (,) to separate the dates. Search for videos within the last:- hour
- today
- week
- month
- year
--video-duration=durationβ whether or not to search for long or short videos. Possible options:- short
- long
--type=typeβ the type of results to get.- video
- playlist
- channel
- all
--thumbnail-quality=qualityβ select the quality of the thumbnails π¦. Available options:- maxres
- maxresdefault
- sddefault
- high (default)
- medium
- default
- start β the first frame of the video (low quality)
- middle β the middle frame of the video (low quality)
- end β the end frame of the video (low quality)
--features=featuresβ the features to have on a video (comma separated).- hd
- subtitles
- creative_commons
- 3d
- live
- 4k
- 360
- location
- hdr
--regionβ the region (country code) to search. Supported by the scrapesyoutube/Yandyoutube-trending/T.
π Miscellaneous π
--ii=instance,--invidious-instance=instanceβ use a different invidious instance.--rii,--refresh-inv-instanceβ if this flag is provided, refresh the instance cache with healthy instances using the Invidious API π₯--available-inv-instancesβ prints the invidious instances that may be used and exits.--channel-link=linkβ converts channel links from'https://youtube.com/c/name'to'https://youtube.com/channel/id'.-qβ use search history instead of a search. This can also be set in the config file withsearch_source=hist.--search-sourceβ the source to use for the search query. Valid values include:argsβ use commandline arguments as the search (default)promptβ ask for a search via a prompthistβ use search history.nextβ used internally to use the next search in the list whenmulti_searchis enabled.fn-argsβ used internally to use the function arguments passed to the function as the source.<custom>β a custom search source may be used if a function calledget_search_from_<source>exists. The function must set the_searchvariable to a search.
-x,--history-clear=<search|watch>β clear search and watch history (if-xor--history-clearis used). To specify either search or watch history, use--history-clear=<search|watch>.--keep-cacheβ whether or not to keep the cache after ytfzf exits. This can also be set in the config file withkeep_cache.--ytdl-opts=optionβ pass command-line options to youtube-dl when downloading. example:--ytdl-opts=--ytdl-path=pathβ specify the path to youtube-dl or a fork of youtube-dl for downloading. This can also be set in the config file withytdl_path.-e,--ext=extensionβ load an extension. You may also addload_extension extensionto your config file.--list-addonsβ lists all addons and exits.--thumbnail-logβ sets the file to log thumbnail debug info to. This can also be set in the config file withthumbnail_debug_log.
π CONFIGURATION π
The default behaviour of ytfzf can be changed by modifying the config file. See ytfzf(5) for more information.
π§ ADDONS π§
There are a few types of addons, bestie:
- interfaces (
-i,--interface) - scrapers (
-c,--scrape) - sort-names (
--sort-name) - thumbnail-viewers (
-T,--thumb-viewer) - url-handlers (
-u,--url_handler) - extensions (
-e,--ext)
To install an addon, place the addon in $YTFZF_SYSTEM_ADDON_DIR/<addon-type>/addon-name
To use an addon, use one of the options listed above, or add this to your configuration file:
load_interface <interface>
scrape=<scraper>
load_sort_name <sort-name>
load_thumbnail_viewer <viewer>
load_url_handler <url-handler>
load_extension <ext>
β EXIT CODES β
0β Success π1β General error2β Invalid--option, option value, or configuration error.3β Missing dependency5β Empty search
πΈ ENVIRONMENT πΈ
okay bestie so these are the environment variables that ytfzf reads, and every single one of them is lowkey a little dial you can turn. go off π
$YTFZF_CONFIG_DIRβ the directory where config files live. the default is$XDG_CONFIG_HOME/ytfzf(or~/.config/ytfzfif that's not a thing you set) π$YTFZF_CONFIG_FILEβ the config file to use. default is$YTFZF_CONFIG_DIR/conf.shβ¨$YTFZF_SUBSCRIPTIONS_FILEβ the subscriptions file to use. default is$YTFZF_CONFIG_DIR/subscriptionsπ$YTFZF_SCRAPELIST_FILEβ the scrapelist file to use. default is$YTFZF_CONFIG_DIR/scrapelistπ¦$YTFZF_THUMBNAIL_VIEWERS_DIRβ the directory that keeps your additional thumbnail viewers. default is$YTFZF_CONFIG_DIR/thumbnail-viewersπ«Ά$YTFZF_CUSTOM_SCRAPERS_DIRβ the directory where custom scraper scripts go. the default is$YTFZF_CONFIG_DIR/scrapersπ₯$YTFZF_CUSTOM_INTERFACES_DIRβ the directory where custom interface scripts go. the default is$YTFZF_CONFIG_DIR/interfacesπ$YTFZF_SORT_NAMES_DIRβ the directory where custom sort-name scripts go. the default is$YTFZF_CONFIG_DIR/sort-namesβ$YTFZF_URL_HANDLERS_DIRβ the directory where custom url handlers go. the default is$YTFZF_CONFIG_DIR/url-handlersπ$YTFZF_CUSTOM_THUMBNAILS_DIRβ the directory where custom thumbnails go. the default is$YTFZF_CONFIG_DIR/thumbnailsπ$YTFZF_EXTENSIONS_DIRβ the directory where extensions go. the default is$YTFZF_CONFIG_DIR/extensionsπ§$YTFZF_SYSTEM_ADDON_DIRβ the directory where system installed addons live. the default may vary depending on how you installed ytfzf, so likeβ¦ it's giving mystery, it's giving depends β¨$YTFZF_CHECK_VARS_EXISTSβ whether or not to check if variables are set in the environment before setting default values. the default is1π$YTFZF_TEMP_DIRβ the temporary directory. the default is$TMPDIR/ytfzf-$user-id. if$TMPDIRis not defined it will use/tmpπ
π FILES π
the little guys that live on your disk, bestie:
~/.config/ytfzf/conf.shβ the configuration file. ifsubmenu-conf.shdoes not exist, this will also be used as the config in submenus πΈ~/.config/ytfzf/submenu-conf.shβ the submenu configuration file π~/.config/ytfzf/subscriptionsβ the subscriptions file π
πΎ CACHE πΎ
okay so every single instance of ytfzf gets its own little directory inside $YTFZF_TEMP_DIR. but if $keep_cache is enabled, it uses $cache_dir instead. keeping receipts, periodt π₯
the structure of each instance folder looks like this: (<> represents a placeholder, and ? means optional)
heads up bestie: if an addon scraper is used, it may use undocumented files. so likeβ¦ there might be extra stuff in there, iykyk π
$cache_dir
| -- watch_hist
| -- <search>-<pid>
| | -- created-at
| | -- searches.list
| | -- post-scrape
| | -- <submenu-search>-<submenu-pid>?
| | -- thumbnails?
| | -- environment
| | -- tmp
| | | -- curl_config
| | | -- <scrape>.html
| | | -- <scrape>.json
| | | -- <scrape>.json.final?
| | | -- menu_keypress
| | | -- all-ids.list
| | | -- downloaded-ids.list
| | -- ids
| | -- videos_json
π«Ά an explanation of each directory/file π«Ά
so you're not out here squinting at filenames like ποΈπποΈ β here's what each one actually is:
created-atcontains the unix timestamp when the folder was created β°searches.lista list of all searches. if--multi-searchis enabled, each search is separated by a new line β¨watch_histthe watch history file π<search>-<pid>an instance's parent folder. if no search was given it uses the name"SCRAPE-<scrape>-<pid>"instead πpost-scrapea folder that contains files relating to the scraping of a selected result π¦<submenu-search>-<submenu-pid>created when a submenu is opened (eg: when a channel/playlist is selected) πthumbnailsstores the thumbnails for the instance (only with-t) πΌοΈenvironmentevery variable that is set and it's value, in that instance of ytfzf πtmpβ stores less important temporarily used files βcurl_configthe configuration file for curl for downloading thumbnails (only with-t) π₯<scrape>.htmlfor scrapers that need to scrape websites, this is the output of curl πΈ<scrape>.jsonthe json scraped from a website π<scrape>.json.finalthe final json scraped from a website. (is used when multiple threads are used for scraping) πmenu_keypressthe key pressed in fzf β¨οΈall-ids.jsonfile that contains all scraped ids. mainly to compare againstdownloaded-ids.jsonπdownloaded-ids.jsonfile that contains which thumbnails have been downloaded π«Άidsβ the file that stores the id of each selected video π―videos_jsonthe file that stores a json of all videos displayed in fzf. this file is very helpful for making playlists as it is in the same format β¨
β¨ AUTHOR β¨
originally written by pystardust. <https://github.com/pystardust> π
π BUGS π
report bugs on github at <https://github.com/pystardust/ytfzf/issues> β go tell them, bestie, they wanna know π
π SEE ALSO π
ytfzf(5) youtube-dl(1), mpv(1) fzf(1) dmenu(1) β the whole friend group, fr fr π«Ά
π COPYRIGHT π
ytfzf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. π
ytfzf 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 the GNU General Public License for more details. π
you should have received a copy of the GNU General Public License along with ytfzf. if not, see <https://www.gnu.org/licenses/>. β¨
and that's the whole page, bestie π this was ytfzf 2.0, dated 2021 September, aka YTFZF(1) β go forth and scrape iconically πΈβ¨π
π¦ where this page comes from
- alpine 3.24: ytfzf-doc 2.6.2-r0 Β· GPL-3.0-only
- arch rolling: ytfzf 2.6.2-2 Β· GPL-3.0-only
- debian trixie: ytfzf 2.6.1-1 Β· GPL-3.0-only
- nixos 26.05: ytfzf 2.6.2
- nixpkgs unstable: ytfzf 2.6.2
- ubuntu noble: ytfzf 2.6.1-1 Β· GPL-3.0-only
- ubuntu questing: ytfzf 2.6.1-1
- ubuntu resolute: ytfzf 2.6.1-1build1 Β· GPL-3.0-only
- ubuntu stonking: ytfzf 2.6.1-1build1 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms