YTFZF(5) File Formats Manual YTFZF(5) (NAME) ytfzf - ytfzf. (SYNOPSIS) ~/.config/ytfzf/conf.sh (DESCRIPTION) .sh . ytfzf . . (CONFIGURATION FILES) : $XDG_CONFIG_HOME/ytfzf ( $HOME/.config/ytfzf). conf.sh ytfzf (source) . subscriptions : https://www.youtube.com/channel/UCtMVHI3AJD4Qk4hcbZnI9ZQ . "https://www.youtube.com/c/SomeOrdinaryGamers" : ytfzf --channel-link="https://www.youtube.com/c/SomeOrdinaryGamers" 'comment#' . : link-to-channel #comment link-to-channel #best channel scrapers (scrape) . (CUSTOM SCRAPERS) . (CONFIGURATION OPTIONS) (VARIABLES) conf.sh ytfzf . . conf.sh : variable_name="value" $ . $cache_dir (). $__is_submenu 0 . : $XDG_CACHE_HOME/ytfzf ( $HOME/.cache/ytfzf) $hist_file $enable_hist 1 . $__is_submenu 0 . : $cache_dir/watch_hist $search_hist_file $enable_search_hist 1 . : $cache_dir/search_hist . $is_detach (detach) . : 0 $is_audio_only . : 0 $url_handler . load_url_handler . URL handlers . : multimedia_player $yt_video_link_domain ( odysee peertube ). invidious ytfzf . : https://www.youtube.com $info_to_print . : L | l | link URL . VJ | vj | video-json json . J | j | json json . F | f | format . R | r | raw . $info_wait_action $info_wait 1 . : q ( $is_loop 1 ). Q . m . : q $info_wait . : 0 $video_pref youtube-dl mpv. : bestvideo $audio_pref youtube-dl mpv. : bestaudio $ytdl_pref youtube-dl mpv. : $video_pref+$audio_pref/best/$video_pref/$audio_pref $url_handler_opts mpv . url_handler_opts . $interface . : load_interface interface-name : ext -D scripting -a -r -A '' $external_menu_len interface_ext (-D) : 210 $fzf_preview_side fzf. : left right up down : left $preview_window_width fzf : 50% $thumbnail_viewer : load_thumbnail_viewer viewer : sixel iterm2 kitty sway wayland ueberzug chafa chafa-16 chafa chafa-tty chafa catimg catimg-256 catimg mpv mpv (tiling) . imv mpv swayimg sway swayimg-hyprland hyprland . swayimg . : ueberzug $show_formats . : 0 $format_selection_screen . : simple normal : simple $format_selection_sort --format-sort ytdl. : height $enable_submenus . . ( youtube/invidious ) : 1 $enable_actions . : 1 $keep_vars ytfzf . $enable_back_button . : 1 $submenu_opts . : $submenu_scraping_opts ( submenu_opts ) $submenu_opts . : $is_sort . : 0 $fancy_subs . : 0 $fancy_subs_left fancy_subs 1 . : ------------- $fancy_subs_right fancy_subs 1 . : $fancy_subs_left $show_thumbnails fzf . : 0 $async_thumbnails () . . : 0 $skip_thumb_download . : 0 $thumbnail_quality . ( API invidious ). '-cS' invidious ( 'SI' ). . : maxres maxresdefault sddefault high () medium default start ( ) middle ( ) end ( ) $notify_playing . : 0 $is_loop . : 0 $search_again fzf . : 0 $selection_meta_key . : alt $download_shortcut . : $selection_meta_key-d $video_shortcut . : $selection_meta_key-v $audio_shortcut . : $selection_meta_key-m $detach_shortcut (detach). : $selection_meta_key-e $print_link_shortcut . : $selection_meta_key-l $show_formats_shortcut . : $selection_meta_key-f $info_shortcut . : $selection_meta_key-i $search_again_shortcut . : $selection_meta_key-s $action_meta_key . : ctrl next_page_action_shortcut . : $action_meta_key-p $shortcut_binds fzf . : Enter,double-click,$download_shortcut, $video_shortcut,$detach_shortcut,$print_link_shortcut,$show_formats_shortcut, $info_shortcut,$search_again_shortcut,$custom_shortcut_binds" $custom_shortcut_binds . $shortcut_binds . $shortcut_binds . $is_auto_select -n ( $interface=scripting ). : 0 $is_random_select -n ( $interface=scripting ). : 0 $is_specific_select ( $scripting_video_count ) ( $interface=scripting ). : 0 $scripting_video_count -a -r . : 1 () $scrape . : youtube, youtube-trending, youtube-subscriptions, peertube, odysee/lbry. youtube-playlist, youtube-channel, invidious-channel, video-recommended, playlist/json-file, json JSON . history, url/U, u, M/multi, comments : youtube $multi_search . : 0 $search_sort_by . relevance () rating ( ) upload_date oldest_first ( odysee) view_count ( ) $search_upload_date : hour today week month year $search_video_duration . : short long $search_result_type . video () playlist channel all ( ) $nsfw (nsfw) odysee/O. : false $search_result_features ( ). hd subtitles creative_commons 3d live 4k 360 location hdr $search_region ( ) . : US $invidious_instance invidious . : https://vid.puffyan.us $pages_to_scrape /invidious. : 1 $pages_start . : 1 $max_thread_count (threads) . ( ) : 20 $odysee_video_search_count odysee. : 30 $sub_link_count . : 2 $gap_space . :' ' $scrape_search_exclude . . : youtube-subscriptions S SI T youtube-trending H history $custom_scrape_search_exclude . $scrape_search_exclude . . : $gap_space : 115 spaces $enable_hist : 1 $enable_search_hist : 1 $search_source . : args () prompt () hist . next multi_search . fn-args . $log_level (). 2 1 0 : 2 $thumbnail_debug_log . :/dev/null $useragent useragent . : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.152 Safari/537.36" $ytdl_opts youtube-dl . $ytdl_path youtube-dl . yt-dlp youtube-dl . : youtube-dl (Option Parsing) $long_opt_char . : - $optstring getopts. . : ac:de:fhi:lmn:qrstu:xADHI:LS:T:W:$long_opt_char: $YTFZF_CHECK_VARS_EXISTS . export ytfzf : YTFZF_CHECK_VARS_EXISTS=0 ytfzf ... :1 (State) . $__is_submenu . $__is_fzf_preview fzf . __scrape_count 1 . (FUNCTIONS) . : function_exists "". external_menu() $interface ext_menu fzf . (prompt) . get_sort_by() $is_sort 1 . : "title |channel |duration |views |date |id". data_sort_fn() . . custom_info_wait_action_() $info_wait_action . $info_wait_action : custom_info_wait_e. . video_info_text() . url . : title channel duration views date url . thumbnail_video_info_text() fzf . . : title channel duration views date url thumbnail_video_info_text_() thumbnail_video_info_text() . on_no_thumbnail() get_ueberzug_positioning_left() $width $height $x $y . $x $y . fzf $fzf_preview_side left . : max_width max_height get_ueberzug_positioning_right() $width $height $x $y . $x $y . fzf $fzf_preview_side right . : max_width max_height get_ueberzug_positioning_up() $width $height $x $y . $x $y . fzf $fzf_preview_side up . : max_width max_height get_ueberzug_positioning_down() $width $height $x $y . $x $y . fzf $fzf_preview_side down . : max_width max_height get_swayimg_positioning_left() $x $y $img_w $img_h . $x $y . fzf $fzf_preview_side left . : img_w img_h max_width max_height max_height term_x term_y col_px_width line_px_height get_swayimg_positioning_right() $x $y $img_w $img_h . $x $y . fzf $fzf_preview_side right . : img_w img_h max_width max_height max_height term_x term_y col_px_width line_px_height get_swayimg_positioning_up() $x $y $img_w $img_h . $x $y . fzf $fzf_preview_side up . : img_w img_h max_width max_height max_height term_x term_y col_px_width line_px_height get_swayimg_positioning_down() $x $y $img_w $img_h . $x $y . fzf $fzf_preview_side down . : img_w img_h max_width max_height max_height term_x term_y col_px_width line_px_height search_prompt_menu() $_search . ytfzf ( ). . search_prompt_ext() $_search . ytfzf ( -D ). . quick_menu() (echo ) -f -q ( ). stdin 1: . stdin: ( ) quick_menu_ext() quick_menu() quick_menu() -D . stdin 1: . stdin: ( ) info_wait_prompt() info_wait . . info_wait_prompt_ext() info_wait_prompt() -D . . info_wait_prompt_wrapper() info_wait_prompt_ . display_text() . . display_text_ext() . . display_text_wrapper() display_text_ . (URL handlers) URL URL : $video_pref , $is_audio_only , $is_detach URL URL . . multimedia_player() . $is_audio_only (-m) video_player() audio_player() . . video_player() . audio_player() . downloader() () . get_video_format_() $format_selection_screen ytdl_pref . on_open_url_handler_() open_url_handler . . close_url_handler_ - _ . . . after_close_url_handler_ close_url_handler_ . is_detach 1 url_handler . (Search History) handle_search_history() . : 1 2 . parse_search_hist_file() . stdin . get_search_from_() search_source . _search . . on_search() . : 1 2 on_search_() . . 1 get_requested_info_() info_to_print . . handle_playing_notifications() . . post_scrape() post_scrape_() post_scrape() on_opt_parse() . (override) . : 1 2 3 . -a $1 . --long-option "-" . 4 . -c S $2 . --long-option=value -long-option=value . on_opt_parse_() . . : 1 (optarg) 2 3 on_post_set_vars() . . on_clean_up() . . usage() print_help_ . . handle_custom_keypresses() handle_keypress() . 0 handle_keypress() . : 1 . handle_custom_post_keypresses() handle_post_keypress() 0 handle_post_keypress() . . $keypress_file . handle_keypress_*() "*" : alt_d "-" "_" . handle_custom_keypresses() 0 . . handle_post_keypress_*() "*" : alt_d "-" "_" . handle_custom_post_keypresses() 0 . . handle_custom_action() ( JSON) . : . : 1 2 (CUSTOM THUMBNAILS) $YTFZF_CUSTOM_THUMBNAILS_DIR . : .jpg ytfzf thumbnails $cache_dir/search . . ytfzf : $YTFZF_CUSTOM_THUMBNAILS_DIR/YTFZF:DEFAULT.jpg . (VIDEO JSON FORMAT) . (objects) . : ID (string): url (string): title (string): scraper (string): json ( ) thumbs (string): channel (string): duration (string): (: [HH:]MM:SS) views (string): date (string): (: : 3 days ago) action (string): "action [key=value key2=value2...]" JSON: [ { "ID": "dQw4w9WgXcQ", "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "title": "definitely not never gonna give you up" } ] (PLAYLISTS) json JSON json : ytfzf -I VJ (SORT NAMES) $YTFZF_SORT_NAMES_DIR : data_sort_fn() get_sort_by() (CUSTOM SCRAPERS) $YTFZF_CUSTOM_SCRAPERS_DIR . (APPEND) "$ytfzf_video_json_file" . /bin/sh . : on_startup_ (source) ( ). . thumbnail_video_info_text_ . thumbnail_video_info_text() . scrape_next_page_ . alt-p ctrl-p ${session_cache_dir}/-current-page . scraper _ - . "scraper" JSON . fzf alt-p . . handle_custom_action_ . "-" "_" . . 1 : 1 2 (CUSTOM INTERFACES) $YTFZF_CUSTOM_INTERFACES_DIR . "$ytfzf_video_json_file" () "$ytfzf_selected_urls" . /bin/sh . : interface_ _ -. . interface_ json . ( ). : search_prompt_menu_() search_prompt_menu() . . search_prompt_menu_ext() . quick_menu_() quick_menu() . . quick_menu_ext() . display_text_() . . ... info_wait_prompt_() info_wait_action . info_wait_action . . (THUMBNAIL VIEWERS) $YTFZF_THUMBNAIL_VIEWERS_DIR . : 1 : start stop view no-img 2 . 3 x ( ) 4 y ( ) 5 ( ) 6 ( ) 7 ( ) ( ) 8 ( ) ( ) 9 (x y ) up down left right (EXTENSIONS) . $YTFZF_EXTENSIONS_DIR $YTFZF_SYSTEM_ADDON_DIR/extensions . ytfzf ( ). $__loaded_path . . $YTFZF_CONFIG_FILE : load_extension name-of-extension : __ytfzf__ __ytfzf_multisearch__ __ytfzf_multisearch__ $multi_search 1 . - _ : on_clean_up_() . . on_no_thumbnail_() . . after_close_url_handler_() . . on_post_set_vars_() ext_name ( - _ ). on_post_set_vars ext_on_search_() . : 1 2 post_scrape_() . . on_init_search_() . : 1 (UTILITY FUNCTIONS) : refresh_inv_instances() "https://api.invidious.io/instances.json?sort_by=type,health,api" $cache_dir/instances.json . . get_invidious_instances() invidious api . . create_sorted_video_data() jsonl . run_interface() interface_ $ytfzf_video_json_file $ytfzf_selected_urls . download_thumbnails() $skip_thumb_download 0 . : ; .jpg $thumb_dir . prepare_for_set_args() $OLD_IFS $IFS $IFS set -f . . 1 IFS. end_of_set_args() IFS OLD_IFS . . modify_ifs() IFS . . 1 IFS . end_modify_ifs() $IFS (unset) . . mul_str() stdout . . 1 . 2 . remove_ansi_escapes() ansi stdin . stdout . . do_an_event_function() event_ $loaded_extensions ( ) . . 1 . ... detach_cmd() (detach) . . 1 ... . source_scrapers() $scrape . $__is_fzf_preview 0 on_startup_ . : $YTFZF_CUSTOM_SCRAPERS_DIR $YTFZF_SYSTEM_ADDON_DIR/scrapers $YTFZF_CUSTOM_SCRAPERS_DIR $YTFZF_SYSTEM_ADDON_DIR/scrapers add_commas() ( ). stdin stdout . . command_exists() . 0 1 . . 1 get_key_value() - (key_value) . - : key=value... . - . stdout $KEY_VALUE . 0 1 . . 1 -. 2 . 3 () - . . title_str() stdout . . 1 . shuf() shuf . shuf print_info() $log_level 2 stderr . . 1 print_warning() $log_level 1 stderr . . 1 print_error() $log_level 0 stderr . . 1 clean_up() ytfzf(1) $session_cache_dir $keep_cache 0 $session_cache_dir . on_clean_up . . is_relative_dir() . 0 1 . . 1 die() print_error . . 1 2 print_error . trim_url() stdin url stdout . : text....|url . get_search_from_source() _search . . 1 . ... $1 fn- args 1 ... get_search_from_<1> . load_extension() $loaded_extensions . : $YTFZF_EXTENSIONS_DIR $YTFZF_SYSTEM_ADDON_DIR/extensions $PATH . . 1 extension_is_loaded() . . 1 load_sort_name() sort-name . sort-name : $YTFZF_SORT_NAMES_DIR $YTFZF_SYSTEM_ADDON_DIR/sort-names sort-name 1 sort-name . . 1 sort-name load_url_handler() $url_handler url-handler . url-handler : $PATH $YTFZF_URL_HANDLERS_DIR $YTFZF_SYSTEM_ADDON_DIR/url-handlers url-handler die . . 1 url load_interface() $interface . $1 ext scripting "" $interface 1 . : $1 $YTFZF_CUSTOM_INTERFACES_DIR $YTFZF_SYSTEM_ADDON_DIR/interfaces . 1 load_thumbnail_viewer() $thumbnail_viewer thumbnail-viewer . $i $thumbnail_viewer . : $1 $YTFZF_THUMBNAIL_VIEWERS_DIR $YTFZF_SYSTEM_ADDON_DIR . 1 _get_request() . . 1 ... curl(1) _get_real_channel_link() : @user https://www.youtube.com/user/ https://www.youtube.com/c/ . 1 ytfzf 2.0 2021 September YTFZF(5)