commit b8dcecfdd97abc8557126f16ae09f136ee07d902
parent c11f3736ac11806e5f1a83775d55794c01e56263
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Wed, 28 Oct 2020 13:43:36 +0100
plumb: try out mplayer(1) instead of mpv(1)
Diffstat:
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/.local/bin/plumb b/.local/bin/plumb
@@ -117,7 +117,7 @@ handle_file_type() {
audio/*|\
application/ogg|\
application/octet-stream)
- mpv "$1";;
+ mplayer "$1";;
text/html)
detach $BROWSER "$1";;
text/troff)
@@ -206,11 +206,11 @@ handle_url() {
fi
if regeximatch "$t" '\.(mp4|mkv|webm|avi|ogv|gif|m3u|pls)$'; then
- detach $prefix mpv "$t"
+ detach $prefix mplayer "$t"
elif regeximatch "$t" '^radio://'; then
- $prefix mpv "http${t##radio}"
+ $prefix mplayer "http${t##radio}"
elif regeximatch "$t" '\.(mp3|ogg|m3u)$'; then
- $prefix mpv "$(fetch "$t")"
+ $prefix mplayer "$(fetch "$t")"
elif regeximatch "$t" '\.(png|jpg|jpeg|tif|bmp|gif)$'; then
$prefix sxiv -a "$(fetch "$t")"
elif regeximatch "$t" '\.(pdf|ps|epub|djvu)$'; then
@@ -233,7 +233,11 @@ handle_url() {
mandoc -l "$(fetch "$t")"
fi
elif regeximatch "$t" '(youtube\.|youtu\.be|vimeo\.com|invidious|invidio\.us|invidious\.snopyta\.org)'; then
- cd ~/tmp && detach $prefix mpv "$t"
+ #detach $prefix mpv "$t"
+ f="$(mktemp).webm"
+ youtube-dl "$t" -o "$f"
+ $prefix mplayer "$f"
+ rm "$f"
elif regeximatch "$t" '^(http|https)://' || \
regeximatch "$t" '\.webp$'; then
detach $prefix $BROWSER "$t"