Releases: pystardust/ytfzf
V2.4
This was originally going to be 2.3.1
because I wanted this to be a bugfix centric update.
But that did not end up happening.
Additions
Features
-
Async thumbnail download.
- Instead of having to wait for thumbnails to download, use
--async-thumbnails
(orasync_thumbnails=1
in the config) - This will open the menu, then download thumbnails in the background.
- Instead of having to wait for thumbnails to download, use
-
multi
scraper, allows multiple ytfzf calls to be done at once- eg:
ytfzf -c M search 1 :NEXT search 2 :NEXT -c O odysee search :NEXT --pages=3 3 pages of youtube
-
mpv
thumbnail viewer, very similar toimv
, but usesmpv
as an image viewer instead ofimv
-
multi-search
is smarter.- Each search is paired with a scraper
- eg:
ytfzf -cO,Y odysee search 1,youtube search 1,odysee search 2,youtube search 2
-
on_no_thumbnail
, a funciton that runs when no thumbnail is found, or whenYTFZF:DEFUALT.jpg
is used -
close_url_handler_<name>
, a function that happens to clean up the url handler- should be the name of the url handler with _ replacing -
-
after_close_url_handler
, a function that happens after the clean up forurl_handler
. -
check_vars_exists
is a variable that can only be set in the environment- if set to 1 variables set in envronment will be used (this is the default)
Options
--ii
, specifies the invidious instance to use--pages-start
, specifies which page to start on, (only works forscrape_invidious_search
)
Addons
Scrapers
-
yt-music
, scrapes youtube music- requires the
yt-music-playlist
scraper, andyt-music-utils
folder to be in the scrapers folder. - it's a big buggy but it works
- requires the
-
feed-url
, gets the rss feed of youtube channels and subreddits. (inspired by #542)- eg:
ytfzf -c feed-url youtube/pewdiepie
- eg:
Extensions
- pressing ctrl-c in mpv with the
auto-play
extension enabled, will also quit out ofytfzf
(#538 @qoheniac )
Deprecated
- having
--submenu-scraping-opts
be seperate from--submenu-opts
is confusing.--submenu-opts
now does both jobs
Changes
- The default search prompt prints to
/dev/stderr
instead of/dev/stdout
--sort-name
no longer looks in $PATH for a valid sort-name function, as 99.9% of the time this is not what's wanted, to use a file, use a relative or absolute path instead.
Fixes
- Many parameter expansions caused
ytfzf
to not play nicely with some shells --format-selection=simple
will work significantly better- did not work with livestreams
- more consistent with oddly sized videos
chafa
tried to use sixel sometimes.--channel-url
now works properly with youtube links that don't contain www- async scraping in subscriptions causes issues with fancy subs sometimes
- Submenus should generally work better
Removed
- multi filter, use
ytfzf -cM --sort-by=sort-1 search :NEXT -cO --sort-by=sort-2 search
instead- yes it's a bit long however multi-filter was very cumbersome in the code, and the use case was too specific.
submenu
andsubmenu.json
files no longer exist due to the refactor of how submenus work
Technical
- Submenus no longer recursively call ytfzf, instead it
- resets all variables to a default state
- You may set
keep_vars
to 1 or use--keep-vars
to override this
- You may set
- spawns a subshell
- sources
$YTFZF_CONFIG_DIR/submenu-conf.sh
if it exists, otherwise it sources your config - parses opts given in
--submenu-opts
, and calls the main function again.
Edit:
ytfzf --version
outputs an incorrect version, see #551
V2.3
Key
- bolded changes are changes that are more noticable to the user.
- Only changes outside of the Additions section will be bolded
Additions
Features
- extensions, extra config files located in
$YTFZF_CONFIG_DIR/extensions
- video recommendations scraper (video-recommended)
- the recommendations are based on a video url
- so use a video url instead of normal search for this scraper
- the recommendations are based on a video url
- Search operators
- This isn't really a new feature as addons could've done this previously
- The real change is that
:help
should but doesn't have to be in every scraper - Usage: when the search is
:help
a little bit of information about the scraper will be printed
swayimg
image viewer, should work on all terminals in the sway compositorYTFZF:DEFAULT.jpg
- is an image that can be in
~/.config/ytfzf/thumbnails
- will be shown when the actual thumbnail doens't exist
- is an image that can be in
Options
--ext
load an extension--list-addons
lists all installed addons and exits--url-handler-opts
extra opts to pass to the url handler, by default this is mpv
Addons
Extensions
- notify-info
- notify-send info, errors, and warnings instead of printing it
- auto-play
- when a video finishes, automatically play the next recommended one
- gui
- a basic gui interface instead of using the commandline (is SERIOUSLY lacking in features)
- requires the
gui
interface
Scrapers
- Scrape lists (a more powerful subscriptions file)
- can be kinda buggy when provided another scrape list, hence why it's an addon
- ard, scrapes https://www.ardmediathek.de/ (@Xystel)
- supports
--pages
, and partially--thumbnail-quality
- supports
Interfaces
- gui
- opens a gui interface instead of a tui or other
Url Handlers
- mpvq (@jose1711)
socat
, andlsof
are required commands for this- works with
--detach
, - when selecting videos, instead of opening new mpv windows, it appends it to the queue of the current mpv instance
Changes
- The default
format_selection_screen
(-f
) is nowsimple
instead ofnormal
- Custom thumbnails are shown before downloaded thumbnails
ytdl_pref
now defaults to$video_pref+$audio_pref/best/$video_pref/$audio_pref
instead of$video_pref+$audio_pref/$video_pref/$audio_pref
- use the ueberzug json parser instead of simple parser (31b365a)
Fixes
- The default interface breaks if column is not found
- The default interface breaks if tput is not found
add_commas
messing up the view count, giving an incorrect number (@gardockt)- When a shortcut is used in fzf, it stays permenantly
- Quotation marks and backslashes are prefixed by a \ (@gardockt)
- -f is broken with a new version of
yt-dlp
IFS
not unset in various places, which could cause weird behaviour- When
-s
orsearch_again
is enabled, submenus produce an error - handling of duplicate entries is not very good (@gardockt)
- Use posix shell in fzf instead of
$SHELL
$session_temp_dir
and$session_cache_dir
are not set in url handlers- Many typos were fixed in the man pages. (@jose1711)
--pages
not working inscrape_invidious_channel
get_missing_thumbnails
does not work with busybox utils.get_ueberzug_positioning
does not work with chafa, and other thumbnail viewers-x
is offset in the-h
texton_startup_*
is no longer called each time a new item is selected in fzf
Docs
- Remove mentions of display thumbnail viewer
Technical Changes
- scrapers are sourced after
ytdl_pref
is set instead of before
Style
- shiftwidth=4, and tabstop=4 are enforced in vim now
V2.2
To Update
If you installed with make
on Linux on version 2.0 or prior, run sudo make uninstall-old
before sudo make install doc
git clone -b v2.2 https://github.com/pystardust/ytfzf
cd ytfzf
sudo make install doc
Package maintainers, please read the notice at the bottom
Additions
Features
addons
folder for less supported featurescomments
scraper, eg:ytfzf -c comments "https://vid.puffyan.us/watch?v=dQw4w9WgXcQ"
(658bf50)- asynchronous scraping for
youtube/Y
andinvidious-channel
(43a06199ca0d37f419697a189982f11b4b0e1ec90) - wait for input when using
-I
or-L
(7691692) - multi search, use multiple searches for multiple scrapers (f63b064)
- kitty thumbnail viewer (4a5ef64)
Options
-S
flag, a more presice-a
flag. (793aa51)--format-sort
A way to sort the formats with-f
(1e5f672)--format-selection
to choose between simple (the old way) and normal format selection screens (1e5f672)--disable-back
to disable the back button, however leaving the submenu still goes back to main menu. (7650b4b)--fancy-subs
has been readded (2a3f1c9)--sort-name
a way to use a different sorting algorithm than the default--sort
(7d79e4e)--fzf-opts
and--fzf-thumbnail-opts
(4a45b49)custom_search_scrape_exclude
to more easily manage scrapes that don't need a search query (66e88d0)handle_keypress_*
, eg:handle_keypress_alt_d
this way you don't have to have a big case statement inhandle_custom_keypresses
(8ad6316)on_clean_up
config function (d3114bb)on_opt_parse_<opt_name>
config function (7d2f06b)
New Addons
Scrapers
- ani (anime scraper) (requires openssl)
- ddg (duckduckgo) (requires ddgr)
- invidious-popular
- recommended
- yt (regular youtube search (no invidious))
- osu (scrapes the new beatmaps on osu.ppy.sh)
Thumbnail Viewers
- display
Interfaces
- sxiv
Sort Names
- alpha
- alpha-rev
Changes
-f
now asks for audio pref and video pref separately instead of assumingbestaudio
(6ec9c08)video_pref
,audio_pref
, andytdl_pref
are now 3 different variables to reduce confusion. (6ec9c08)- the default
video_pref
is nowbestvideo
instead ofbest
- the default
audio_pref
isbestaudio
- the default
ytdl_pref
is$video_pref+$audio_pref/$video_pref/$audio_pref
- the default
- changed the shebang from
#!/bin/sh
to#!/usr/bin/env sh
to be more portable. - the default
thumbnail_quality
ishigh
instead ofdefault
(355b29b). - the default
yt_video_link_domain
is nowhttps://youtube.com
for better compatibility with video players (66e6ab9). - the order of
log_level
is now the opposite (2 = everything, 1 = warnings/errors, 0 = errors) (723f510)
Fixes
- playlists scrape infinitely (e9786b32167e648685fe7a4974e3cfc4b5d114330)
- relative paths to interfaces didn't work (3ef2e95)
--detach
works with-m
(fd945ad)- "%'" invalid directive (8d7b1b4)
- Having quotes in the search query breaks curl (6e1a7a2)
- Somtimes when not all info is provided the labels in thumbnail display were off.
- when
-q
and-s
are enabled, it will ask for search normally after the first search. (68ef357) - sub process of ytfzf are not killed when main thread is killed. (3abcd5c)
--thumb-viewer
can point to just a regular executable file (a86feb9)
Removed
display
thumbnail viewer is now an addon (a065223)set_save_custom_filters
(bed5944)init_multi_filters
(bed5944)manage_multi_custom_filters
(bed5944)
Github
- added
CONTRIBUTING.md
- added a
credits
section in theREADME
next update i probably won't keep track of commits as it was more effort than it was worth
For package maintainers
- There is a variable in the script called
YTFZF_SYSTEM_ADDON_DIRS
, if you want to package it so that addons are installed in a system path, make sure this variable points to the correct location.- Make sure to not point this to
~/.config/ytfzf/
as this is the user addons dir - You can either make it point to the correct location by either:
- modifying the script
- exporting it as an environment variable in a global startup file of some kind (eg: /etc/environment)
- Make sure to not point this to
Ytfzf v2.1
To Update
The install location on linux has changed from /usr/bin
to /usr/local/bin
to be consistent on all OS, and to avoid gnumake only syntax.
In addition the man page location changed from /usr/share/man/man*
to /usr/local/share/man
to be consistent.
git clone https://github.com/pystardust/ytfzf
cd ytfzf
git checkout v2.1
#if on linux and installed any version 2.0 and prior run the command below
sudo make uninstall-old
#everyone uses the command below
sudo make install doc
If you wish to not install documentation (highly unrecommended) run sudo make install
instead.
Additions
- Search history (
-q
) - imv thumbnail viewer
- search again (
-s
) - custom
serch_prompt_menu
s depending on the interface - custom
quick_menu
s depending on the interface --submenu-scraping-opts
, because--submenu-opts
does not apply to scraping for submenus (eg:--pages
)- alt-s to search again
- alt-i to get all info about a video
Changes
- players are now not responsible for sending notifications, that is the job of
handle_playing_notifications
- (linux only) make installs to /usr/local/bin instead of /usr/bin
- man pages install to /usr/local/share/man instead of /usr/share/man (@Vouivre)
- Makefile also now uses ${DESTDIR}, and ${PREFIX} (@Vouivre)
-
search_prompt_menu
has been documented.
Fixes
- man pages not able to install on mac.
- Makefile is now posix compliant
- Docs about -D, -a, -r, -A are outdated
- is_ext_menu had been removed
- is_interface_scripting had been removed
-
$interface
undocumented -
$external_menu_len
undocumented - alt-v, alt-d, and alt-m do nothing
- the default for
submenu_opts
is 1 (should be empty) -
make uninstall
doesn't uninstall ytfzf(5) - ytfzf(1) and ytfzf(5) install with execute permissions
- curl not treated as a dependency when it is
- thumbnail-viewers:
chafa-16
andcatimg-256
were broken - No commas in view count
- add a backup posix compliant
shuf
function in case shuf is not installed -
-A
selects a maximum of 100 videos - if curl failed while downloading thumbnails for any reason, it would call curl again (@soystemd)
- Videos without a seperate audio stream will make video_pref default to best, overriding user selection with -f.
-
notify_playing
incorrectly documented asnotify_video_playing
Codebase
interface=scripting
,interface=ext
, andinterface=""
are now all treated the same as user created interfaces.- all have their own
quick_menu*
, andsearch_prompt_menu*
- all have their own
Next update I will also try to have links to commits for all changes.
Plans for 2.2
- scraping
--pages
in youtube asynchronously- you could scrape 100 pages in the time it takes to scrape 1
- addons folder that can be installed with
make addons
- this will allow us to add more buggy scrapers, menus, and thumbnail viewers, as they will be marked as unofficial
--fzf-opts
and--fzf-thumbnail-opts
to pass opts to fzf in menucustom_scrape_search_exclude
to simplify adding scrape search exceptions toscrape_search_exclude
If you find any bugs, have any questions, or anything else, feel free to open an issue :)
Ytfzf 2.0
We didn't like the old code base so we decided to rewrite it.
The goal is to keep the codebase simple, and avoid features that lots of complexity.
To update to the new release
git clone https://github.com/pystardust/ytfzf
cd ytfzf
sudo make install man
If you do not wish to install man pages (highly unrecommended) run sudo make install
instead.
Changes
Assume your current config file doesn't work with this update, see ytfzf(1) and ytfzf(5).
Feel free to ask here or on the discord for help.
Breaking Changes
- Many variables have been renamed
- Many config options (such as video_player) that were strings are now functions
Additions
-
Scrapers for invidious
-
-I to get various information about a video instead of playing it
-
support for w3m image display (although it's a bit buggy)
-
submenus, eg: when clicking on a playlist, it scrapes the playlist and opens it
-
multi-scrape, scrape multiple websites at once
-
framework for playlists
- To see what a playlist file looks like, check out the
~/.cache/ytfzf/watch_hist
file (after you watch a video and if you have history enabled)
- To see what a playlist file looks like, check out the
-
Modularity
- ability to add things such as scrapers, and thumbnail viewers yourself
Documentation
- All documentation has been moved into the man pages, instead of conf.sh
- this allows us to change default settings to fix bugs as everyone seemed to copy and paste the default config file
Removed
- Search history
- however it is possible to implement this yourself in conf.sh using the on_search function
Bugs
- At least 1 bug has been fixed
- Many bugs have probably been introduced and uncaught, please file a bug report if you find any :)