|YTFZF(1)||General Commands Manual||YTFZF(1)|
ytfzf - search and play videos
ytfzf is a POSIX script that helps you find videos from Youtube, Peertube or Odysee (without API) and opens/downloads them using mpv/youtube-dl.
Search operators are special search queries.
Standard search operators include:
- Prints a possibly brief description of how to use the scraper.
Addon scrapers may have more or less search operators
How to play the selected videos.
- -d, --download
- Download the selected videos. This can also be set in the config file with is_download.
- -m, --audio-only
- Play audio only. This can also be set in the config file with is_audio_only.
- -f, --formats
- Show available formats before proceeding.
- The format selection screen type to use.
- The --format-sort to use in ytdl. This can also be set in the config file with format_selection_sort.
- Set the ytdl video format to pref. This can also be set in the config file with video_pref.
- Set the ytdl audio format to pref. This can also be set in the config file with audio_pref.
- Set the ytdl format to pref. This can also be set in the config file with ytdl_pref.
- Detach the video player from the terminal. This can also be set in the config file with is_detach.
- The function/program to use as a url handler. This can also be set in the config file with url_handler.
- -I option
- Instead of playing the selected videos, get information about them in the selected format. The available options are:
- Opts to pass to the url handler, by default this will pass extra opts to mpv. This can also be set in the config file with url_handler_opts.
- -l, --loop
- Reopen the menu when the video stops playing. This can also be set in the config file with is_loop.
- -s, --search-again
- After closing fzf make another search. This can also be set in the config file with search_again.
- -t, --show-thumbnails
- Show thumbnails. Doesn't work with -D or -H. This can also be set in the config file with show_thumbnails.
- Whether or not to skip the thumbnail download. This is used if you want to
not have thumbnails, or use custom thumbnails in
For more info see CUSTOM THUMBNAILS in ytfzf(5)
This can also be set in the config file with skip_thumb_download.
- Show notifications when a video is about to be played. This can also be set in the config file with notify_playing.
- The preview side in fzf.
- Use program for displaying thumbnails.
- chafa, chafa with 16 colors, chafa with 4 colors.
- catimg, catimg with 256 colors.
- Uses a workaround to get w3m to work in fzf, may take up a lot of cpu.
- Good with tiling window managers
- For the kitty terminal.
- Only works on the sway wayland compositor.
- Additional viewers can be put into $YTFZF_THUMBNAIL_VIEWERS_DIR.
- -D, --external-menu
- Use an external menu instead of fzf. The default is dmenu. This can also be set in the config file with interface="ext".
- Use a custom interface script, which would be in $YTFZF_CUSTOM_INTERFACES_DIR. This can also be set in the config file with interface.
- Sorts videos (after scraping) by upload date.
- Calls a function set in $YTFZF_CONFIG_FILE. Or sources a script in $YTFZF_SORT_NAMES_DIR (if it exists). See SORT NAMES in ytfzf(5) for more information.
- Whether or not to have a separator between each subscription. When this
option is used it automatically disbables --sort as it will mess up this
This can also be set in the config file with fancy_subs.
- Whether or not to disable the back button in submenus.
This can also be set in the config file with enable_back_button.
- 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 with enable_submenus.
- The opts to use in the submenu.
This can also be set in the config file with submenu_opts.
- The opts to use for scraping in the submenu.
This can also be set in the config file with submenu_scraping_opts.
- -a, --auto-select
- Auto-play the first result.
- -A, --select-all
- Select all results.
- -r, --random-select
- Auto-play a random result.
- -S sed address, --select=sed address
- Auto-play a specific video.
- Select the second video
- Select the last video
- Select all videos starting with h
- -n number, --link-count=number
- The number of videos to select with -a or -r.
- -c scrapers, --scrape=scrapers
- Set which scraper to use. Multiple scrapers can be separated by comma (,). The currently supported builtin scrapers are:
- Scrapes invidious' api with a search query
- Scrapes a youtube channel with youtube
- Scrapes a youtube channel with $invidious_instance
When this scrape is active the search query is the link to a channel.
- Scrapes recommended videos from an invidious video link
- Scrapes a youtube playlist
When this scrape is active the search query is the link to a playlist.
- Scrapes invidious' api to get youtube trending.
When this scrape is active the search query is the tab of trending to scrape.
- SI Scrapes invidious for channels instead of youtube. Scraping youtube may result in rate limiting.
- uses your $YTFZF_SCRAPELIST_FILE as scrape and search input. See "scrape lists" ytfzf(5) for more information.
- (Only if $enable_hist is enabled)
- Opens the url in the video player and exits
- Scrapes the comments of a video link from youtube
- -H, --history
- Alias for -c H.
Scrapes history file.
- Same as -c, but keeps the default scrape as well.
- Removes scraper from list of scrapers to use
- Whether or not to use multi search.
To use multi search, separate each search with a comma, this works well when using multiple scrapers.
This can also be set in the config file with multi_search.
- When using the youtube scraper, convert the invidious links to youtube links before playing/downloading.
Currently, --video-duration, --type, --thumbnail-quality, and --features only applies to the scrape: youtube/Y
- Amount of pages to scrape on youtube/invidious, and the comments scraper. This can also be set in the config file with pages_to_scrape.
- 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 with max_thread_count.
- Set the max_thread_count to 1, this has the same effect as making
everything single threaded. (this does not apply to the subscription
This can also bet set in the config file with max_thread_count=1.
- Amount of videos to scrape on odysee. This can also be set in the config file with odysee_video_search_count.
- Whether or not to search for nsfw videos.
Only works with odysee/O This can also be set in the config file with nsfw.
- Works with youtube/Y and odysee/O.
To use a different sort for each scrape, use comma (,) to separate the sorts.
As apposed to --sort, this happens during the search, not after. Results should sort by:
- Works with youtube/Y and odysee/O
To use a different sort for each scrape, use comma (,) to separate the dates.
Search for videos within the last:
- Whether or not to search for long or short videos. Possible options:
- The type of results to get.
- Select the quality of the thumbnails. Available options:
- The features to have on a video (comma separated).
- The region (country code) to search.
Supported by the scrapes youtube/Y and youtube-trending/T
- Converts channel links from 'https://youtube.com/c/name' to 'https://youtube.com/channel/id'
- Use search history instead of a search. This can also be set in the config file with use_search_hist.
- -x, --history-clear=<search|watch>
- Clear search and watch history (if -x or --history-clear is used)
To specify either search or watch history use --history-clear=<search|watch>
- Whether or not to keep cache after ytfzf exists. This can also be set in the config file with keep_cache.
- Pass command-line options to youtube-dl when downloading.
example: --ytdl-opts='-o ~/Videos/%(title)s.%(ext)s'
- Specify the path to youtube-dl or a fork of youtube-dl for downloading.
This can also be set in the config file with ytdl_path.
- Load an extension.
You may also add load_extension extension to your config file.
- Lists all addons and exits.
The default behaviour of ytfzf can be changed by modifying the config file. See ytfzf(5) for more information.
- The directory to store config files. The default is $XDG_CONFIG_HOME/ytfzf (or ~/.config/ytfzf)
- The configuration file to use. The default is $YTFZF_CONFIG_DIR/conf.sh
- The subscriptions file to use. The default is $YTFZF_CONFIG_DIR/subscriptions
- The scrapelist file to use. The default is $YTFZF_CONFIG_DIR/scrapelist
- The directory to keep additional thumbnail viewers. The default is $YTFZF_CONFIG_DIR/thumbnail-viewers
- The directory to store custom scraper scripts in The default is $YTFZF_CONFIG_DIR/scrapers
- The directory to store custom interface scripts in the default is $YTFZF_CONFIG_DIR/interfaces
- The directory to store custom sort-name scripts in the default is $YTFZF_CONFIG_DIR/sort-names
- The directory to store custom url handlers in the default is $YTFZF_CONFIG_DIR/url-handlers
- The directory to store custom thumbnails the default is $YTFZF_CONFIG_DIR/thumbnails
- The directory to store extensions the default is $YTFZF_CONFIG_DIR/extensions
- The directory to store system installed addons. The default may vary depending on how you installed ytfzf. $cache_dir The directory to store cache the default is $XDG_CACHE_HOME/ytfzf (or $HOME/.cache/ytfzf)
- The configuration file
- The submenu configuration file
- The subscriptions file.
- Watch history (if $enable_hist is 1)
Each instance of ytfzf has its own directory in $cache_dir.
The structure of $cache_dir looks like this: (<> represents a placeholder, ? means optional)
$cache_dir | -- watch_hist | -- <search>-<pid> | | -- post-scrape | | -- <submenu-search>-<submenu-pid>? | | -- thumbnails? | | -- tmp | | | -- curl_config | | | -- <scrape>.html | | | -- <scrape>.json | | | -- menu_keypress | | | -- submenu.json? | | -- ids | | -- videos_json
An explanation of each directory/file:
- The watch history file.
- An instance's parent folder.
If no search was given it uses the name "SCRAPE-<scrape>-<pid>" instead.
- A folder that contains files relating to the scraping of a selected result.
- Created when a submenu is opened (eg: when a channel/playlist is selected).
- The folder to hold information about the submenu, all subitems are the same as the parent equivelent.
- Stores the thumbnails for the instance (only with -t).
- Stores less importatnt temporarily used files.
- The configuration file for curl for downloading thumbnails (only with -t).
- For scrapers that need to scrape websites, this is the output of curl.
- The json scraped from a website.
- The key pressed in fzf.
- A temp json file used to store the video_json of links to be put into the submenu.
- The file that stores the id of each selected video.
- The 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.
Originally written by pystardust. <https://github.com/pystardust>
Report bugs on github <https://github.com/pystardust/ytfzf/issues>
ytfzf(5) youtube-dl(1), fzf(1) dmenu(1)
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/>.
|2021 September||ytfzf 2.0|