I am making the yt-dl program used in the `cast` userscript
configurable, via a pattern borrowed from some of the other
userscripts here (e.g. `password_fill` and `kodi`): we look for an
optional "cast_rc" file in the qutebrowser config directory and source
it if it exists.
(Technically this allows for overriding any variables used in `cast`,
but this is in line with how the pattern works in the other scripts
already.)
If the config file is not found, we default to yt-dlp, and if that
doesn't exist then youtube-dl. If after all this no program is
available, we emit an error message
(note, the error messaging function as currently written in the cast script
seems broken and doesn't display the full error message, but fixing this
existing bug is outside of the scope of this change. May be good for a
followup).
I recognize there's some danger of breakage for some users by switching
the default to yt-dlp, but I think it's reasonable to assume that almost
everybody who has yt-dlp installed would prefer it to be used anyway.
Those who don't will experience no difference.
The `cast` userscript hasn't worked for me in a while, because it attempts to launch youtube-dl which has been replaced by yt-dlp for some time. Switching this one command gets `cast` working for me.
Now collects all (non-ignored) files via `git ls-files` and only skips
some binary formats.
Also adds some type annotations and fixes some newly unconvered
UK-spellings.
Custom location installed castnow can't be killed with the command
`pkill -f /usr/bin/castnow`. Now recover the path to the binary in the path for
calling and killing the program.