From fc0eecc37e57b9b44d372ae50db7ff58ac5e1f9f Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Wed, 9 Oct 2024 14:28:52 +0200
Subject: [PATCH 001/122] Update README.md
---
README.md | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index b38cd32d..5cb9e898 100644
--- a/README.md
+++ b/README.md
@@ -63,8 +63,6 @@ Recommended extras:
- `notify-send`
- `yt-dlp`
-Check for missing dependencies using `mpvc-installer check-reqs`.
-
## Installation
- [Manual](#manual)
@@ -78,7 +76,8 @@ Check for missing dependencies using `mpvc-installer check-reqs`.
Installing is just a matter of fetching the scripts either via [Git](#git)/Curl/etc., scripts can be used directly from the repo, the `mpvc-installer` bit is just there for easiness, to fetch & link them into your `BINDIR=~/bin/` that [mpvc-installer](../../blob/master/extras/mpvc-installer) does by default.
-The easiest for a onetime [Manual](#manual) install, however for @latest version a [Git](#git) install is recommended.
+The easiest for a onetime install is the [Manual](#manual), however for @latest version a [Git](#git) install is recommended.
+Check for missing dependencies/requirements using `mpvc-installer check-reqs`.
### Manual
@@ -235,6 +234,8 @@ Like any piece of software, mpvc is not perfect:
- mpvc depends on shell tools. If your shell is misconfigured or you are using
unusual variants of basic UNIX tools, mpvc is not guaranteed to work. However,
all effort has been made to make mpvc as POSIX compliant as possible.
+ Remember to check for missing dependencies/requirements using `mpvc-installer check-reqs`.
+
Check out the [Issue Tracker](../../issues) for further improvements to be made.
From ad3e793a509df47ab1ca66f919ac24fc4b5830db Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Wed, 9 Oct 2024 14:53:26 +0200
Subject: [PATCH 002/122] Update issue templates
---
.github/ISSUE_TEMPLATE/bug_report.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index f4b4156e..058448c9 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -15,5 +15,7 @@ Steps to reproduce the behavior:
1. Run command '...'
2. See error
+(Ensure that the issue can be reproduced on a clean install, and that there are no missing deps/reqs using `mpvc-installer check-reqs`)
+
**Expected behavior**
A clear and concise description of what you expected to happen.
From 52f9075dc5d9fa62bae1d9f6fa639a899b836c4a Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Wed, 9 Oct 2024 17:19:36 +0200
Subject: [PATCH 003/122] extras: Update extras/mpvc-installer
---
extras/mpvc-installer | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/extras/mpvc-installer b/extras/mpvc-installer
index b5b08422..1d5ef800 100755
--- a/extras/mpvc-installer
+++ b/extras/mpvc-installer
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
#
# @file mpvc-installer
# @version v1.0
@@ -116,6 +116,7 @@ mpvc_uninstall()
mpvc_check_requirements()
{
# attempt at listing packages required by mpvc & extras/ to work
+ command -v "sh" || echo "$PROGNAME: Error: No sh(1) found. Install to continue."
command -v "mpv" || echo "$PROGNAME: Error: No mpv found. Install to continue."
command -v "fzf" || echo "$PROGNAME: Error: No fzf found, Install to continue"
command -v "awk" || echo "$PROGNAME: Error: No awk found, Install to continue" # gawk ???
From 59490ec4daef9c3818f92f6e197295f6e8be319d Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Thu, 10 Oct 2024 15:20:24 +0200
Subject: [PATCH 004/122] extras: Update extras/mpvc-installer
---
extras/mpvc-installer | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/extras/mpvc-installer b/extras/mpvc-installer
index 1d5ef800..e2cb5cef 100755
--- a/extras/mpvc-installer
+++ b/extras/mpvc-installer
@@ -116,8 +116,8 @@ mpvc_uninstall()
mpvc_check_requirements()
{
# attempt at listing packages required by mpvc & extras/ to work
- command -v "sh" || echo "$PROGNAME: Error: No sh(1) found. Install to continue."
- command -v "mpv" || echo "$PROGNAME: Error: No mpv found. Install to continue."
+ command -v "sh" || echo "$PROGNAME: Error: No sh found. Install to continue"
+ command -v "mpv" || echo "$PROGNAME: Error: No mpv found. Install to continue"
command -v "fzf" || echo "$PROGNAME: Error: No fzf found, Install to continue"
command -v "awk" || echo "$PROGNAME: Error: No awk found, Install to continue" # gawk ???
command -v "sed" || echo "$PROGNAME: Error: No sed found, Install to continue" # gsed ???
From 9011a313faace5ac4dea78604c7e90edb487ecc7 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Thu, 10 Oct 2024 15:20:30 +0200
Subject: [PATCH 005/122] mpvc: Update mpvc
---
mpvc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mpvc b/mpvc
index ad835d60..2061feac 100755
--- a/mpvc
+++ b/mpvc
@@ -47,6 +47,7 @@ EOF
-L | --loopfile : Loop currently playing file.
-m | --mute : Toggle sound.
-t | --seek : Increase/decrease playback time relatively, accepts % values.
+ | --seekrand : Set a random playback time.
-T | --time : Set absolute playback time.
-x | --speed : Increase/decrease speed relative to the current speed.
-X | --speedval : Set absolute speed.
@@ -573,6 +574,7 @@ mpvc_appendtracks() {
mpvc_get_random() { od -vAn -N2 -tu2 < /dev/urandom; }
mpvc_play_random() { mpvc_set_track "$(mpvc_get_random)" "absolute"; }
+mpvc_seek_random() { d=$(mpvc_get duration); mpvc_set_time "absolute" "$(( $(mpvc_get_random) % ${d%%.*} ))"; }
mpvc_play_now() {
mpvc_play_next "$@"
@@ -585,7 +587,8 @@ mpvc_play_next() {
mpvc_appendtracks "$@"
lid_last="$(( $(mpvc_get playlist-count) - 1 ))"
lid_next="$(( $(mpvc_get playlist-pos) + 1 ))"
- for f in "$@"; do
+ for f in "$@";
+ do
mpvc_move_track "$lid_last" "$lid_next"
done
}
@@ -1041,6 +1044,7 @@ main() {
# random) MPV doesn't have this control option!
# GNU-style options
+ --seekrand|seekrand) shift; mpvc_seek_random;;
-t|--seek|seek) shift; mpvc_set_time "relative" "${1:-}" ;;
-T|--time|time) shift; mpvc_set_time "absolute" "${1:-}" ;;
-v|--vol) shift; mpvc_add "volume" "${1:-}" ;;
From 2894d8daf35499ff338f9a2d8f9274d2a31d73a1 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Fri, 11 Oct 2024 08:11:02 +0200
Subject: [PATCH 006/122] mpvc: Update mpvc
---
mpvc | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/mpvc b/mpvc
index 2061feac..36a22bef 100755
--- a/mpvc
+++ b/mpvc
@@ -481,14 +481,14 @@ mpvc_stash() {
apply_current)
while read -r line; do
case "$line" in
- "# $PROGNAME "*) echo "$line";;
- "mpvc --mpv") mpvc_mpv;;
- "mpvc --wait") mpvc_wait;;
- "mpvc mpv") mpvc_mpv;;
- "mpvc wait") mpvc_wait;;
- "mpvc cmd "*) mpvc_cmd ${line##mpvc cmd };;
- "mpvc set "*) mpvc_set ${line##mpvc set } || true;;
- "mpvc add "*) mpvc_appendtrack "${line##mpvc add }";;
+ "# $PROGNAME "*) quietcheck warn "$line";;
+ "mpvc --mpv") quietcheck mpvc_mpv;;
+ "mpvc --wait") quietcheck mpvc_wait;;
+ "mpvc mpv") quietcheck mpvc_mpv;;
+ "mpvc wait") quietcheck mpvc_wait;;
+ "mpvc cmd "*) quietcheck mpvc_cmd ${line##mpvc cmd };;
+ "mpvc set "*) quietcheck mpvc_set ${line##mpvc set } || true;;
+ "mpvc add "*) quietcheck mpvc_appendtrack "${line##mpvc add }";;
esac
done
;;
@@ -559,7 +559,7 @@ mpvc_appendtrack() {
# cache media here if media is found in local storage
if [ "$MPVC_LOCAL_CACHE" = "true" ]; then filename=$(echo "$filename" | $PROGDIR/mpvc-fzf -C); fi
mpvc_ecmdr "loadfile" "$filename" "append-play" || return 1
- echo "Adding: $(mpvc_curl_cache_title_clean "$filename")"
+ quietcheck warn "Adding: $(mpvc_curl_cache_title_clean "$filename")"
fi
}
From 937ba236b362d3072d2196ff53a94a7017a9b40c Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Fri, 11 Oct 2024 16:45:41 +0200
Subject: [PATCH 007/122] extras: Update extras/mpvc-web
---
extras/mpvc-web | 46 +++++++++++++---------------------------------
1 file changed, 13 insertions(+), 33 deletions(-)
diff --git a/extras/mpvc-web b/extras/mpvc-web
index 43fa02f8..2bd1a464 100755
--- a/extras/mpvc-web
+++ b/extras/mpvc-web
@@ -36,9 +36,8 @@ mpvc_web_defaults()
MPVC_WEB_PORT=${MPVC_WEB_PORT:-8000}
MPVC_WEB_ROOT=${MPVC_WEB_ROOT:-/tmp/mpvc-web/root}
MPVC_WEB_SSL_PORT=${MPVC_WEB_SSL_PORT:-8443}
- MPVC_WEB_SSL_PEM=${MPVC_WEB_SSL_PEM:-$MPVC_WEB_ROOT/../stunnel.pem}
- MPVC_WEB_SSL_CFG=${MPVC_WEB_SSL_CFG:-$MPVC_WEB_ROOT/../stunnel.cfg}
- MPVC_WEB_SSL_PID=${MPVC_WEB_SSL_PID:-$MPVC_WEB_ROOT/../stunnel.pid}
+ MPVC_WEB_SSL_PEM=${MPVC_WEB_SSL_PEM:-$MPVC_WEB_ROOT/../ssl.pem}
+ MPVC_WEB_SSL_PID=${MPVC_WEB_SSL_PID:-$MPVC_WEB_ROOT/../ssl.pid}
MPVC_WEB_SSL_ENABLE=${MPVC_WEB_SSL_ENABLE:-}
MPVC_WEB_SSL_VERIFY=${MPVC_WEB_SSL_VERIFY:-0}
MPVC_WEB_ARCHIVE_ENABLE=${MPVC_WEB_ARCHIVE_ENABLE:-}
@@ -82,8 +81,8 @@ mpvc_web_config()
echo "$PROGNAME: Error: No python3 found, install to continue."
exit
fi
- if ! command -v stunnel >/dev/null; then
- echo "$PROGNAME: Warning: No stunnel found, install to support SSL."
+ if ! command -v socat >/dev/null; then
+ echo "$PROGNAME: Warning: No socat found, install to support SSL."
fi
}
@@ -461,30 +460,12 @@ mpvc_web_favicon()
EOF
}
-mpvc_web_stunnel_cfg()
+mpvc_web_https()
{
- cat <
The solution has been to change the defaults: so now mpvc-web runs by
default on localhost, and, a new option: `MPVC_WEB_SSL_ENABLE=1 mpvc-web`
-setups a `stunnel(1)` HTTPS connection, this allows to address the HTTPS security part.
-Next, to address the authentication part, `stunnel(1)` provides peer
+setups a `socat(1)` HTTPS connection, this allows to address the HTTPS security part.
+Next, to address the authentication part, `socat(1)` provides peer
certificate verification, so using the new option `MPVC_WEB_SSL_ENABLE=1 MPVC_WEB_SSL_VERIFY=2 mpvc-web`
only clients that provide a valid peer certificate can connect to mpvc-web.
-One particular feature where improvement could be done mpvc -a audio.opus, when mpv finishes playing audio.opus, mpv terminates, and, the current playlist is lost. This happens as mpv is started with --idle=once. A solution for this is to start mpv separately with --idle=yes. A shortcut for this is to run `mpvc --mpv` that does exactly this, after this the mpv instance can be manipulated with mpvc, and does not terminate once mpv finishes playing.
+One particular feature where improvement could be done is
Check mpv-mpris for docs/setup, below is a quick setup:
-
While mpvc was playing `The Number 4` from Khruangbin's EP `The Infamous Bill` decided it would be fun to interface mpvc with a USB LCD on the Raspberry PI that acts as a jukebox, so each time a track starts output what's playing now for some seconds, and then poweroff the LCD. Turned out nice and easy by using
From 39918b10ee0821813fc74ecf54525cdd56caca58 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Thu, 24 Oct 2024 07:08:59 +0200
Subject: [PATCH 013/122] Update README.md
---
README.md | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 5cb9e898..de12e42e 100644
--- a/README.md
+++ b/README.md
@@ -74,7 +74,7 @@ Recommended extras:
- [Gentoo](#gentoo-mpvc)
- [Nix](#nix-mpvc)
-Installing is just a matter of fetching the scripts either via [Git](#git)/Curl/etc., scripts can be used directly from the repo, the `mpvc-installer` bit is just there for easiness, to fetch & link them into your `BINDIR=~/bin/` that [mpvc-installer](../../blob/master/extras/mpvc-installer) does by default.
+Installing is just a matter of fetching the scripts either via [Git](#git)/Curl/etc., scripts can be used directly from the repo, the `mpvc-installer` bit is just there for easiness, to fetch & link them into your `BINDIR=~/bin/` that [mpvc-installer](../../blob/master/extras/mpvc-installer) does by default.
The easiest for a onetime install is the [Manual](#manual), however for @latest version a [Git](#git) install is recommended.
Check for missing dependencies/requirements using `mpvc-installer check-reqs`.
@@ -98,8 +98,6 @@ This does git clone, and symlinks the mpvc scripts to `BINDIR` (default `~/bin`)
(cd mpvc; extras/mpvc-installer link-user)
(cd mpvc; extras/mpvc-installer check-reqs)
- # use mpvc-fzf to search and play youtube media
- mpvc-fzf -p 'kupla mirage'
# use mpvc to add/load/save media files or online YT URLs
mpvc add /path/to/your/*.mp3 # or your URLs
find . -type f -name | mpvc load
@@ -110,6 +108,10 @@ This does git clone, and symlinks the mpvc scripts to `BINDIR` (default `~/bin`)
mpvc stash push current
mpvc stash apply current
+ # use mpvc-fzf to manage mpvc stash (see mpvc-fzf -h for more)
+ mpvc-fzf -a
+ # use mpvc-fzf to search and play youtube media
+ mpvc-fzf -p 'kupla mirage'
# use mpvc-fzf to manage the playlist
mpvc-fzf -f
# use mpvc-tui to start the tui + desktop notifications
From 879820be4004f19ac336bf7c03f02ce888df092a Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sat, 26 Oct 2024 05:45:55 +0200
Subject: [PATCH 014/122] extras: Update extras/mpvc-tui
---
extras/mpvc-tui | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/extras/mpvc-tui b/extras/mpvc-tui
index 9dbc13d1..f8cb195a 100755
--- a/extras/mpvc-tui
+++ b/extras/mpvc-tui
@@ -43,9 +43,9 @@ mpvctui_defaults()
# config defaults
NO_COLOR="${NO_COLOR:-}"
- MPVC_TUI_COLOR0="$MPVC_TUI_CGREENL"
- MPVC_TUI_COLOR1="$MPVC_TUI_CCYAN"
- MPVC_TUI_COLOR2="$MPVC_TUI_CYELLOW"
+ MPVC_TUI_COLOR0="${MPVC_TUI_COLOR0:-$MPVC_TUI_CGREENL}"
+ MPVC_TUI_COLOR1="${MPVC_TUI_COLOR1:-$MPVC_TUI_CCYAN}"
+ MPVC_TUI_COLOR2="${MPVC_TUI_COLOR2:-$MPVC_TUI_CYELLOW}"
MPVC_TUI_UPDATEC=${MPVC_TUI_UPDATEC:-2}
MPVC_TUI_CLEARC=${MPVC_TUI_CLEARC:-4}
@@ -53,6 +53,9 @@ mpvctui_defaults()
MPVC_TUI_TIPS=${MPVC_TUI_TIPS:-true}
MPVC_TUI_TERM=${MPVC_TUI_TERM:-xterm}
MPVC_TUI_SHELL=$(readlink -f /proc/$$/exe)
+
+ MPVC_TUI_STATUS_CMD="${MPVC_TUI_STATUS_CMD:-status}"
+ MPVC_TUI_PLAYLIST_CMD="${MPVC_TUI_PLAYLIST_CMD:-playlist}"
export MPVC_TUI_CLINE=${MPVC_TUI_CLINE:-11}
}
@@ -136,9 +139,9 @@ mpvctui_watcher()
{
mpvctui_header0 "${MPVC_TUI_HEADER0}$(mpvctui_tips)"
mpvctui_header1 "Status"
- mpvc status
+ mpvc "${MPVC_TUI_STATUS_CMD}"
mpvctui_header1 "Playlist"
- mpvc playlist
+ mpvc "${MPVC_TUI_PLAYLIST_CMD}"
mpvctui_header1 "Prompt"
}
From 2391cb7e3596777aa74842438ea14752f440e994 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sat, 26 Oct 2024 05:48:10 +0200
Subject: [PATCH 015/122] docs: Update docs/logbook.html
---
docs/logbook.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/logbook.html b/docs/logbook.html
index f013b9b4..efb35b6e 100644
--- a/docs/logbook.html
+++ b/docs/logbook.html
@@ -379,7 +379,7 @@
-Continuing with the topic of the previous post about mpvc-equalizer, one reason for starting mpvc, was to ease was to managing audio from the CLI. In that sense mpv integrates well with ffmpeg to apply AV filters. However you've to, either start mpv specifying the ffmpeg cli flags for the AV-filters, or add keyboard shortcuts into the input.conf to be triggedred during runtime.
+Continuing with the topic of the previous post about mpvc-equalizer, one reason for starting mpvc, was to ease was to managing audio from the CLI. In that sense mpv integrates well with ffmpeg to apply AV filters (##https://ffmpeg.org/ffmpeg-filters.html"). However you've to, either start mpv specifying the ffmpeg cli flags for the AV-filters, or add keyboard shortcuts into the input.conf to be triggedred during runtime.
@@ -367,6 +374,12 @@ On the security of mpvc-web, 17 Nov 2023
On the security of mpvc-web, 17 Nov 2023
On load/save functionality, 18 Nov 2022
On persistent mpv startup, 20 Nov 2022
mpvc -a audio.opus
, when mpv finishes playing audio.opus, mpv terminates, and, the current playlist is lost. This happens as mpv is started with --idle=once. A solution for this is to start mpv separately with --idle=yes. A shortcut for this is to run mpvc --mpv
that does exactly this, after this the mpv instance can be manipulated with mpvc, and does not terminate once mpv finishes playing.
On a minimal mpvc-tui, 03 Dec 2022
@@ -604,10 +604,11 @@ On MPRIS support, 14 Feb 2024
-mkdir -p ~/.config/mpv/scripts
+
+
Then, start a new instance of mpv player that loads `mpris.so`
+mkdir -p ~/.config/mpv/scripts;
+
curl -fsSL -o ~/.config/mpv/scripts/mpris.so https://github.com/hoyon/mpv-mpris/releases/download/1.0/mpris.so
-
@@ -644,9 +645,10 @@ Introducing mpvc-chapter: helper for managing chapters
Introducing mpvc-osd: interfacing mpvc with a 4x20 USB LCD, 5 May 2024
mpvc-tui -S
scrobbling code, and masaging the output to pipe it to the USB LCD for presentation. For the record the output from mpvc-tui
is:
-
+
+.
+
And this is how it looks:
mpvc-tui -S 'echo $(date +"T%H:%M") $(mpvc -f "[%status%] #%position%/%playlistlength% %time% %artist% - %title% - %path%")' 'false'
-
Introducing mpvc-web: a mpvc-tui like hack for the web
As a minor thing I've started aliasing
mpvc
commands that I use frequently to their "m" counterparts in bash, not perfect, but handy enough, and saves some typing:
$ grep mpvc ~/.bashrc
- alias m="mpvc"
+ alias m="mpvc lowfi"
alias mh="alias | grep mpvc"
alias mi="mpvc -i"
alias mI="mpvc -I"
From 1e4030e93d89e6c89f2dbb1b9f6daf70f8c3390b Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sat, 26 Oct 2024 05:50:28 +0200
Subject: [PATCH 016/122] mpvc: Update mpvc
---
mpvc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/mpvc b/mpvc
index 650c9494..706a40de 100755
--- a/mpvc
+++ b/mpvc
@@ -874,7 +874,11 @@ mpvc_print_status() {
}
'
)
- mpvc_cmd "expand-text" "${F}" | awk '{gsub(" \\\\r","\n");print}'
+ mpvc_cmd "expand-text" "${F}" |
+ awk '{
+ # trim/replace times: 00:01:59 -> 01:59
+ gsub(" \\\\r","\n"); gsub(" 00:", " "); gsub("/00:", "/"); print
+ }'
}
mpvc_print_status_final() {
@@ -1137,6 +1141,7 @@ main() {
--delay|delay) mpvc_delay;;
--wait|wait) mpvc_wait;;
--tac|tac) mpvc_tac; exit 0;;
+ --lowfi|lowfi) MPVC_FORMATSTRING='[%status%] β· %title% @ %time%/%length% #%position%/%playlistlength% π§';;
--ttysize|ttysize) mpvc_tty_size; QUIETFLAG=true;;
--ttycols|ttycols) mpvc_tty_cols; QUIETFLAG=true;;
From 87c09baedafa70ec42a55858971eb631060b4b31 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sat, 26 Oct 2024 09:45:15 +0200
Subject: [PATCH 017/122] extras: Update extras/mpvc-fzf
---
extras/mpvc-fzf | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf
index d731063a..8ef31074 100755
--- a/extras/mpvc-fzf
+++ b/extras/mpvc-fzf
@@ -328,15 +328,20 @@ mpvcfzf_urlget()
{
url=${1:-https://localhost:8443/ytdl-archive/}
mpvcfzf_curl "$url" |
- awk '/.*<\/a>/ { h=$0;sub("^.*href=\"","",h);sub("\".*$","",h);print h }'
+ awk -v url="$url" '
+ /.*<\/a>/ {
+ href=$0; sub("^.*href=\"", "", href)
+ sub("\".*$","",href)
+ print (href !~ url) ? url"/"href : href
+ }
+ '
}
mpvcfzf_urlbrowser()
{
url=${1:-https://localhost:8443/ytdl-archive/}
mpvcfzf_urlget "$url" |
- mpvcfzf_preview --prompt="(urlbrowse) " |
- awk -v url="$url" '{ print url$0 }'
+ mpvcfzf_preview --prompt="(urlbrowse) "
}
mpvcfzf_equalizer()
From 3fe25672bdbf4bda6968927e9e14b8df6a977c51 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sat, 26 Oct 2024 09:47:16 +0200
Subject: [PATCH 018/122] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index de12e42e..c3de5168 100644
--- a/README.md
+++ b/README.md
@@ -112,6 +112,8 @@ This does git clone, and symlinks the mpvc scripts to `BINDIR` (default `~/bin`)
mpvc-fzf -a
# use mpvc-fzf to search and play youtube media
mpvc-fzf -p 'kupla mirage'
+ # use mpvc-fzf to browse lofi girl uploads and play music
+ mpvc-fzf -b https://lofigirl.com/wp-content/uploads/2023/06
# use mpvc-fzf to manage the playlist
mpvc-fzf -f
# use mpvc-tui to start the tui + desktop notifications
From 28f2280a90105d970fc39e1bb71a94820b7a1945 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sat, 26 Oct 2024 10:41:59 +0200
Subject: [PATCH 019/122] extras: Update extras/mpvc-fzf
---
extras/mpvc-fzf | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf
index 8ef31074..bd6db770 100755
--- a/extras/mpvc-fzf
+++ b/extras/mpvc-fzf
@@ -268,6 +268,8 @@ mpvcfzf_preview()
--bind='ctrl-t:execute-silent(mpvc add {+1} &)' \
--bind='ctrl-s:execute(mpvc-fzf -c)' \
--bind='ctrl-x:execute(mpvc-fzf -f {q})' \
+ --bind='ctrl-y:execute(mpvc-fzf -b {+1})' \
+ --bind='ctrl-u:execute(mpvc-fzf -b {+1})' \
--bind='ctrl-v:execute(mpvc-fzf -p {q})' \
--bind='ctrl-\:execute(mpvc-fzf -l)' \
\
@@ -330,9 +332,10 @@ mpvcfzf_urlget()
mpvcfzf_curl "$url" |
awk -v url="$url" '
/.*<\/a>/ {
- href=$0; sub("^.*href=\"", "", href)
- sub("\".*$","",href)
- print (href !~ url) ? url"/"href : href
+ match(url, "https?://[^/]+/", host);
+ href=$0; sub("^.*href=\"", "", href) sub("\".*$", "", href)
+ if (href ~ "^/") href = host[0]"/"href
+ print (href !~ host[0]) ? url"/"href : href
}
'
}
From bd1cc2580f2d924b08cc155009ce3596c64791a6 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sat, 26 Oct 2024 11:24:48 +0200
Subject: [PATCH 020/122] Update mpvc
---
mpvc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mpvc b/mpvc
index 706a40de..4012dade 100755
--- a/mpvc
+++ b/mpvc
@@ -157,6 +157,7 @@ mpvc_defaults()
QUIETFLAG="${QUIETFLAG:-}"
MPVC_LOCAL_CACHE="${MPVC_LOCAL_CACHE:-false}"
MPVC_FORMATSTRING="${MPVC_FORMATSTRING:-}"
+ MPVC_FORMATSTRING_LOFI=${MPVC_FORMATSTRING_LOFI:-'[%status%] β· %title% @ %time%/%length% #%position%/%playlistlength% (%volume%%%) π§'}
# print default status of mpv instance
if [ -z "$MPVC_FORMATSTRING" ]; then
@@ -1007,7 +1008,7 @@ main() {
mpvc_config
arg1=${1:-}
case "$arg1" in
- ytquery|ytqueryjson|--tac|tac) ;;
+ ytquery|ytqueryjson|--tac|tac|--lowfi|lowfi) ;;
-k|--kill|kill|-K|--killall|killall) ;;
-c|--crop|crop|-C|--clear|clear|cmd|sockcmd|socklist|--socklist) ;;
-a|add|append|-A|load|--load|playnext|--playnext|-n|playnow|--playnow|mpv|--mpv|stash|--stash|--toggle|toggle|-q|--quiet) ;;
@@ -1141,7 +1142,7 @@ main() {
--delay|delay) mpvc_delay;;
--wait|wait) mpvc_wait;;
--tac|tac) mpvc_tac; exit 0;;
- --lowfi|lowfi) MPVC_FORMATSTRING='[%status%] β· %title% @ %time%/%length% #%position%/%playlistlength% π§';;
+ --lowfi|lowfi) MPVC_FORMATSTRING="$MPVC_FORMATSTRING_LOFI" ;;
--ttysize|ttysize) mpvc_tty_size; QUIETFLAG=true;;
--ttycols|ttycols) mpvc_tty_cols; QUIETFLAG=true;;
From 243fdb9e1bbd04bb1e4243b7f9284dfb01f89c9f Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sat, 26 Oct 2024 11:24:48 +0200
Subject: [PATCH 021/122] Update mpvc
---
mpvc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mpvc b/mpvc
index 4012dade..03623f84 100755
--- a/mpvc
+++ b/mpvc
@@ -157,7 +157,7 @@ mpvc_defaults()
QUIETFLAG="${QUIETFLAG:-}"
MPVC_LOCAL_CACHE="${MPVC_LOCAL_CACHE:-false}"
MPVC_FORMATSTRING="${MPVC_FORMATSTRING:-}"
- MPVC_FORMATSTRING_LOFI=${MPVC_FORMATSTRING_LOFI:-'[%status%] β· %title% @ %time%/%length% #%position%/%playlistlength% (%volume%%%) π§'}
+ MPVC_FORMATSTRING_LOFI=${MPVC_FORMATSTRING_LOFI:-'[%status%] β· %title% πΆ %time%/%length% #%position%/%playlistlength% π%volume%%% π§'}
# print default status of mpv instance
if [ -z "$MPVC_FORMATSTRING" ]; then
From 6698e61db3447cb28d5f0714e7a337a29d54d93b Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sat, 26 Oct 2024 17:45:40 +0200
Subject: [PATCH 022/122] Update mpvc
---
mpvc | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/mpvc b/mpvc
index 03623f84..62d49d94 100755
--- a/mpvc
+++ b/mpvc
@@ -156,12 +156,12 @@ mpvc_defaults()
IMAGEFLAG="${IMAGEFLAG:-}"
QUIETFLAG="${QUIETFLAG:-}"
MPVC_LOCAL_CACHE="${MPVC_LOCAL_CACHE:-false}"
- MPVC_FORMATSTRING="${MPVC_FORMATSTRING:-}"
- MPVC_FORMATSTRING_LOFI=${MPVC_FORMATSTRING_LOFI:-'[%status%] β· %title% πΆ %time%/%length% #%position%/%playlistlength% π%volume%%% π§'}
+ MPVC_FMTSTR="${MPVC_FMTSTR:-}"
+ MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% πΆ %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% π§'}
# print default status of mpv instance
- if [ -z "$MPVC_FORMATSTRING" ]; then
- MPVC_FORMATSTRING="\
+ if [ -z "$MPVC_FMTSTR" ]; then
+ MPVC_FMTSTR="\
%artist% - %title% \r\
[%status%] #%position%/%playlistlength% %time%/%length% (%percentage%%%) \r\
vol:%volume%%% mute:%mute% repeat:%repeat% single:%single% \r\
@@ -845,15 +845,18 @@ mpvc_chapter_search_play()
## Formatting and Printing Functions ##########################################
-# formats and prints according to $MPVC_FORMATSTRING
+# formats and prints according to $MPVC_FMTSTR
mpvc_print_status() {
# not that nice, in fact way more ugly, but also way faster
- F=$(echo "$MPVC_FORMATSTRING" |
+ F=$(echo "$MPVC_FMTSTR" |
awk '
{
split("year genre album icy-title comment volume volume-max mute path height width playback-time ab-loop-[ab] speed force-window video screen aspect idle fullscreen chapter chapters =chapter", RE)
for (i in RE) { re=RE[i]; gsub("%"re"%", "${"re":NA}"); }
+ gsub("%statuslofi%", "${?pause==yes:βΈοΈ}${?pause==no:β·}${!pause:NA}");
+ gsub("%mutelofi%", "${?mute==yes:π}${?mute==no:π}${!mute:NA}");
+
gsub("%status%", "${?pause==yes:paused}${?pause==no:play}${!pause:NA}");
gsub("%title%", "${media-title}")
gsub("%artist%", "${?metadata/by-key/artist:${metadata/by-key/artist}}${!metadata/by-key/artist:NA}")
@@ -1142,14 +1145,14 @@ main() {
--delay|delay) mpvc_delay;;
--wait|wait) mpvc_wait;;
--tac|tac) mpvc_tac; exit 0;;
- --lowfi|lowfi) MPVC_FORMATSTRING="$MPVC_FORMATSTRING_LOFI" ;;
+ --lowfi|lowfi) MPVC_FMTSTR="$MPVC_FMTSTR_LOFI" ;;
--ttysize|ttysize) mpvc_tty_size; QUIETFLAG=true;;
--ttycols|ttycols) mpvc_tty_cols; QUIETFLAG=true;;
--ttylines|ttylines) mpvc_tty_lines; QUIETFLAG=true;;
# global argument parsing
- -f|--format) shift; MPVC_FORMATSTRING="${1:-}" ;;
+ -f|--format) shift; MPVC_FMTSTR="${1:-}" ;;
-S|--socket) shift; mpvc_handle_socket "${1:-}";;
-Q|--vid=no) MPVOPTIONS="$MPVOPTIONS --vid=no"; ;;
--image) IMAGEFLAG=true; ;;
@@ -1164,7 +1167,7 @@ main() {
esac
if [ $# -ge 1 ]; then shift; fi
done
- # produce format strings last
+ # output mpvc status last
quietcheck mpvc_print_status_final
}
From 124c0289d57e766d22bbab67eef29e69ca2a3755 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sat, 26 Oct 2024 20:43:33 +0200
Subject: [PATCH 023/122] Update mpvc
---
mpvc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mpvc b/mpvc
index 62d49d94..8c35186d 100755
--- a/mpvc
+++ b/mpvc
@@ -157,7 +157,7 @@ mpvc_defaults()
QUIETFLAG="${QUIETFLAG:-}"
MPVC_LOCAL_CACHE="${MPVC_LOCAL_CACHE:-false}"
MPVC_FMTSTR="${MPVC_FMTSTR:-}"
- MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% πΆ %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% π§'}
+ MPVC_FMTSTR_LOFI=${MPVC_FMTSTR_LOFI:-'[%status%] %statuslofi% %title% πΆ %time%/%length% #%position%/%playlistlength% %mutelofi%%volume%%% %singlelofi% %repeatlofi% π§'}
# print default status of mpv instance
if [ -z "$MPVC_FMTSTR" ]; then
@@ -856,6 +856,8 @@ mpvc_print_status() {
gsub("%statuslofi%", "${?pause==yes:βΈοΈ}${?pause==no:β·}${!pause:NA}");
gsub("%mutelofi%", "${?mute==yes:π}${?mute==no:π}${!mute:NA}");
+ gsub("%singlelofi%", "${?loop-file==inf:π}${?loop-file==no:π}${!loop-file:NA}")
+ gsub("%repeatlofi%", "${?loop-playlist==inf:π}${?loop-playlist==no:π}${!loop-playlist:NA}")
gsub("%status%", "${?pause==yes:paused}${?pause==no:play}${!pause:NA}");
gsub("%title%", "${media-title}")
From 9961961dde4f018f3d08b9dd799aadc832dbf5d6 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sun, 27 Oct 2024 08:46:26 +0100
Subject: [PATCH 024/122] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index c3de5168..aab91a59 100644
--- a/README.md
+++ b/README.md
@@ -112,7 +112,7 @@ This does git clone, and symlinks the mpvc scripts to `BINDIR` (default `~/bin`)
mpvc-fzf -a
# use mpvc-fzf to search and play youtube media
mpvc-fzf -p 'kupla mirage'
- # use mpvc-fzf to browse lofi girl uploads and play music
+ # use mpvc-fzf to browse & play lofi girl music
mpvc-fzf -b https://lofigirl.com/wp-content/uploads/2023/06
# use mpvc-fzf to manage the playlist
mpvc-fzf -f
From bcbdc604e2bc75a9a8c67484e9f02d3f01b25dd4 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sun, 27 Oct 2024 08:49:21 +0100
Subject: [PATCH 025/122] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index aab91a59..ec280a4b 100644
--- a/README.md
+++ b/README.md
@@ -82,7 +82,7 @@ Check for missing dependencies/requirements using `mpvc-installer check-reqs`.
### Manual
```console
-curl -fsSL -O https://github.com/lwilletts/mpvc/raw/master/extras/mpvc-installer \
+curl -LO https://github.com/lwilletts/mpvc/raw/master/extras/mpvc-installer \
&& BINDIR=$HOME/bin sh ./mpvc-installer fetch-user
```
From 9c460258ed58bb9836735981523e0ec5f5f81b4b Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sun, 27 Oct 2024 17:45:17 +0100
Subject: [PATCH 026/122] docs: Update logbook.html
---
docs/logbook.html | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/logbook.html b/docs/logbook.html
index efb35b6e..3f5964ae 100644
--- a/docs/logbook.html
+++ b/docs/logbook.html
@@ -359,6 +359,7 @@
Logbook Entries
On applying ffmpeg AV filters using the MPV JSON IPC,
mpvc cmdr af toggle "@apulsator:lavfi=[apulsator]"
mpvc cmdr af toggle "@aphaser:lavfi=[aphaser]"
mpvc cmdr af toggle "@aecho:lavfi=[aecho=in_gain=0.9:out_gain=0.9:delays=1:decays=0.9]"
+mpvc cmdr af toggle "@lofi:lavfi=[ladspa=cmt:lofi:controls=c0=80|c1=20|c2=9000]"
# Some vf filters
mpvc cmdr vf toggle "@life:lavfi=[life]"
From 3ab9d0c4a1a4487d33369e16ad4084b823a02f38 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sun, 27 Oct 2024 19:38:58 +0100
Subject: [PATCH 027/122] extras: Update extras/mpvc-fzf
---
extras/mpvc-fzf | 2 ++
1 file changed, 2 insertions(+)
diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf
index bd6db770..68cc2f36 100755
--- a/extras/mpvc-fzf
+++ b/extras/mpvc-fzf
@@ -478,6 +478,7 @@ mpvcfzf_usage()
echo " -x|launch : Starts $PROGNAME in a new $MPVC_TERM (config \$MPVC_TERM) [combine -x with other opts]"
echo " -v|version : Return the $PROGNAME version."
echo " now : Return a shareable URL to the "now listening" playlist"
+ echo " lofi : Search & play Lo-Fi channels"
echo " somafm : Search & play SomaFM channels"
echo " radioapi : Search & play Radio-Browser API channels"
echo "*tips: If unsure about where to begin, start: $PROGNAME -p 'kupla mirage'"
@@ -531,6 +532,7 @@ main()
-v|version) shift; mpvcfzf_version; return ;;
now) shift; mpvcfzf_now; return ;;
+ lofi) shift; mpvcfzf_urlbrowser "https://lofigirl.com/wp-content/uploads/2023/06/" ;;
somafm) shift; mpvcfzf_somafm "${1:-}"; return ;;
radioapi) shift; mpvcfzf_radioapi "${1:-}"; return ;;
#*) shift; mpvcfzf_usage; return ;;
From 48f18559fedcc4a6aa192c6a3ff4c904a8c8fd23 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sun, 27 Oct 2024 19:50:50 +0100
Subject: [PATCH 028/122] extras: Update extras/mpvc-web
---
extras/mpvc-web | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/extras/mpvc-web b/extras/mpvc-web
index 81ec5887..e94c4892 100755
--- a/extras/mpvc-web
+++ b/extras/mpvc-web
@@ -149,6 +149,12 @@ EOF
mpvc_web_index_js()
{
cat <
cycle
rst
+
[
From 45f7e81dc82554affd1c56513547a0313423eb87 Mon Sep 17 00:00:00 2001
From: gmt4 <791491+gmt4@users.noreply.github.com>
Date: Sun, 27 Oct 2024 20:58:45 +0100
Subject: [PATCH 029/122] docs: Update docs/logbook.html
---
docs/logbook.html | 49 ++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 46 insertions(+), 3 deletions(-)
diff --git a/docs/logbook.html b/docs/logbook.html
index 3f5964ae..0b18bb0f 100644
--- a/docs/logbook.html
+++ b/docs/logbook.html
@@ -57,10 +57,12 @@ Contents
+ 2022
Contents
Contents
@@ -324,7 +331,7 @@ Introducing mpvc-equalizer: a basic mpv equalizer for
On applying ffmpeg AV filters using the MPV JSON IPC, 2 June 2023
On applying ffmpeg AV filters using the MPV JSON IPC,
mpvc cmdr vf toggle "@showwaves:lavfi=[showwaves]"
mpvc cmdr vf toggle "@showspectrum:lavfi=[showspectrum]"
mpvc cmdr vf toggle "@avectorscope:lavfi=[avectorscope]"
+
+mpvc cmdr vf toggle "@mirrorbottom:lavfi=[[vid1]split[main][tmp];[tmp]crop=iw:ih/2:0:ih/2,vflip[flip];[main][flip]overlay[vo]]"
+mpvc cmdr vf toggle "@mirrorleft:lavfi=[[vid1]split[main][tmp];[tmp]crop=iw/2:ih:0:0,hflip[flip];[main][flip]overlay=W/2[vo]]"
+mpvc cmdr vf toggle "@mirrorright:lavfi=[[vid1]split[main][tmp];[tmp]crop=iw/2:ih:iw/2:0,hflip[flip];[main][flip]overlay[vo]]"
+mpvc cmdr vf toggle "@hstack:lavfi=[[vid1]split[v1][v2];[v1][v2]hstack[t]]"
+mpvc cmdr vf toggle "@vstack:lavfi=[[vid1]split[v1][v2];[v1][v2]vstack[t]]"
+Recently landed mpvc lowfi
which features a minimal mpvc status that leverages emojis to represent a one-line compressed playing status (aliased to m="mpvc lowfi"
above #logbook-20230721):
+
+ +[play] β· Polaris πΆ 02:35/04:50 #3/33 π60% π π π§ + ++This goes hand in hand with the hability to browse HTTP server listings and add music as in: +
+ +% mpvc-fzf -b https://lofigirl.com/wp-content/uploads/2023/05 +Adding https://lofigirl.com/wp-content/uploads/2023/05/6.Downtown-Binary-_-The-Present-Sound-Polaris.mp3 +[play] β· Polaris πΆ 02:35/04:50 #3/33 π60% π π π§ + ++The
mpvc-fzf -b [URL]
browser works as follows:
+
+hrefs
and outputs all the links that point to the current host, ctrl+[tyu]
shortcuts for mpvc-fzf work as well for local, remote, and other media URLs.
+
+- Last-Modified: Thursday, 4 July 2024 by gmt4 + π Sat, 26 Oct 2024 by gmt4 - Powered by #HTML 𧑠π π + β‘ PoweredBy #HTML
From 4686ed48a2ecf1aa8cbe2007b852a99b94417889 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 28 Oct 2024 06:04:31 +0100 Subject: [PATCH 030/122] extras: Update extras/mpvc-fzf --- extras/mpvc-fzf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extras/mpvc-fzf b/extras/mpvc-fzf index 68cc2f36..64f8fbba 100755 --- a/extras/mpvc-fzf +++ b/extras/mpvc-fzf @@ -264,14 +264,15 @@ mpvcfzf_preview() \ --layout=reverse \ --header="$PROGNAME help: $MPVC_FZF_BIND_HELP" \ - --bind='ctrl-space:execute-silent(mpvc toggle &)' \ - --bind='ctrl-t:execute-silent(mpvc add {+1} &)' \ + --bind='ctrl-a:toggle-all' \ --bind='ctrl-s:execute(mpvc-fzf -c)' \ --bind='ctrl-x:execute(mpvc-fzf -f {q})' \ --bind='ctrl-y:execute(mpvc-fzf -b {+1})' \ --bind='ctrl-u:execute(mpvc-fzf -b {+1})' \ --bind='ctrl-v:execute(mpvc-fzf -p {q})' \ --bind='ctrl-\:execute(mpvc-fzf -l)' \ + --bind='ctrl-t:execute-silent(mpvc add {+1} &)' \ + --bind='ctrl-space:execute-silent(mpvc toggle &)' \ \ --preview-window='up:5' \ --preview="mpvc" \ @@ -532,7 +533,7 @@ main() -v|version) shift; mpvcfzf_version; return ;; now) shift; mpvcfzf_now; return ;; - lofi) shift; mpvcfzf_urlbrowser "https://lofigirl.com/wp-content/uploads/2023/06/" ;; + lofi) shift; mpvcfzf_urlbrowser "${1:-https://lofigirl.com/wp-content/uploads/2023/06/}" ;; somafm) shift; mpvcfzf_somafm "${1:-}"; return ;; radioapi) shift; mpvcfzf_radioapi "${1:-}"; return ;; #*) shift; mpvcfzf_usage; return ;; From 009c3a23638ac38c7218c1aad0c38cc7842a9eed Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 28 Oct 2024 07:11:55 +0100 Subject: [PATCH 031/122] docs: Update docs/logbook.html --- docs/logbook.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/logbook.html b/docs/logbook.html index 0b18bb0f..24da8703 100644 --- a/docs/logbook.html +++ b/docs/logbook.html @@ -415,6 +415,7 @@- Last-Modified: Friday, 13 September 2024 by gmt4 + π Sat, 26 Oct 2024 by gmt4 - Powered by #HTML 𧑠π π + β‘ PoweredBy #HTML
From fa01ac19b4d30cd91df97e8938dd8e5bec7e479f Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 28 Oct 2024 09:22:40 +0100 Subject: [PATCH 034/122] Update mpvc --- mpvc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpvc b/mpvc index 8c35186d..cce04ab6 100755 --- a/mpvc +++ b/mpvc @@ -856,7 +856,7 @@ mpvc_print_status() { gsub("%statuslofi%", "${?pause==yes:βΈοΈ}${?pause==no:β·}${!pause:NA}"); gsub("%mutelofi%", "${?mute==yes:π}${?mute==no:π}${!mute:NA}"); - gsub("%singlelofi%", "${?loop-file==inf:π}${?loop-file==no:π}${!loop-file:NA}") + gsub("%singlelofi%", "${?loop-file==yes:π}${?loop-file==no:π}${!loop-file:NA}") gsub("%repeatlofi%", "${?loop-playlist==inf:π}${?loop-playlist==no:π}${!loop-playlist:NA}") gsub("%status%", "${?pause==yes:paused}${?pause==no:play}${!pause:NA}"); From 459cd877c3e9a782238378982279b964304803d8 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 2 Nov 2024 08:02:41 +0100 Subject: [PATCH 035/122] Update mpvc --- mpvc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mpvc b/mpvc index cce04ab6..51d61f47 100755 --- a/mpvc +++ b/mpvc @@ -102,7 +102,7 @@ EOF Formatting: \`$PROGNAME --format\` will interpret the following delimiters if they are found: - %name%, %path%, %dir%, %title%, %artist%, %album%, %albumartist%, comment%, + %filename%, %path%, %dir%, %title%, %artist%, %album%, %albumartist%, comment%, %genre%, %year%, %icy-title%, %percentage%, %playlistlength%, %position%, %repeat%, %single, %status%, %time%, %precisetime%, %speed%, %length%, %remaining%, %volume%, %mute%, %frame%, %width%, %height%, @@ -851,7 +851,7 @@ mpvc_print_status() { F=$(echo "$MPVC_FMTSTR" | awk ' { - split("year genre album icy-title comment volume volume-max mute path height width playback-time ab-loop-[ab] speed force-window video screen aspect idle fullscreen chapter chapters =chapter", RE) + split("year genre album icy-title comment volume volume-max working-directory mute filename path height width playback-time ab-loop-[ab] speed force-window video screen aspect idle fullscreen chapter chapters =chapter", RE) for (i in RE) { re=RE[i]; gsub("%"re"%", "${"re":NA}"); } gsub("%statuslofi%", "${?pause==yes:βΈοΈ}${?pause==no:β·}${!pause:NA}"); @@ -864,11 +864,9 @@ mpvc_print_status() { gsub("%artist%", "${?metadata/by-key/artist:${metadata/by-key/artist}}${!metadata/by-key/artist:NA}") gsub("%albumartist%", "${?metadata/by-key/album:${metadata/by-key/album}}${!metadata/by-key/album:NA}") gsub("%percentage%", "${percent-pos}") - gsub("%name%", "${filename}") gsub("%repeat%", "${loop-playlist}") gsub("%single%", "${loop-file}") gsub("%frame%", "${estimated-frame-number}") - gsub("%dir%", "${working-directory}") gsub("%remaining%", "${playtime-remaining}") gsub("%length%", "${duration}") gsub("%time%", "${playback-time}") @@ -880,11 +878,9 @@ mpvc_print_status() { } ' ) + # trim/replace times: 00:01:59 -> 01:59 mpvc_cmd "expand-text" "${F}" | - awk '{ - # trim/replace times: 00:01:59 -> 01:59 - gsub(" \\\\r","\n"); gsub(" 00:", " "); gsub("/00:", "/"); print - }' + awk '{ gsub(" \\\\r","\n"); gsub(" 00:", " "); gsub("/00:", "/"); print }' } mpvc_print_status_final() { From 72c365b6635c6696cff7b3e5b2140b8f22481c50 Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Sat, 2 Nov 2024 12:55:33 +0100 Subject: [PATCH 036/122] Update mpvc --- mpvc | 59 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/mpvc b/mpvc index 51d61f47..539799cc 100755 --- a/mpvc +++ b/mpvc @@ -52,6 +52,8 @@ EOF -x | --speed : Increase/decrease speed relative to the current speed. -X | --speedval : Set absolute speed. -I | --image : Enable adding of images to the queue. + | --color : Enable color (NO_COLOR=) + | --nocolor : Disable color (NO_COLOR=true) -k | --kill : Kill the mpv process controlling the given socket. -K | --killall : Kill all mpv processes indiscriminately. -S | --socket : Set mpv socket [default: $MPVC_SOCKET]. @@ -225,39 +227,40 @@ mpvc_curl_cache_json() mpvc_curl_cache -sL "https://youtube.com/oembed?url=$1" } -mpvc_curl_cache_metadata_json_once() { - filename="${1:-}" - result="${1:-}" - case "$filename" in +mpvc_ytquery_json_once() { + for i in "$@" + do + filename="${i:-}" + case "$filename" in https://youtu.be/watch*|https://youtube.com/watch*|https://www.youtube.com/watch*) filename="$(echo "$filename" | sed 's|\(www.\)\?youtube.com|youtu.be|; s|/watch/\??v=|/|')" - result="$(mpvc_curl_cache_json "$filename")" ;; https://youtu.be/*|https://youtube.com/*|https://www.youtube.com/*) - result="$(mpvc_curl_cache_json "$filename")" + result=$(mpvc_curl_cache_json "$filename") ;; https://yewtu.be/watch*) filename="$(echo "$filename" | sed 's|://yewtu.be|://youtu.be|; s|/watch?v=|/|')" - result="$(mpvc_curl_cache_json "$filename")" + result=$(mpvc_curl_cache_json "$filename") ;; https://yewtu.be/*) filename="$(echo "$filename" | sed 's|://yewtu.be|://youtu.be|')" - result="$(mpvc_curl_cache_json "$filename")" + result=$(mpvc_curl_cache_json "$filename") ;; *) # otherwise, assume its a local file result="{ \"title\":${filename##*/}, }" ;; - esac - printf "$result\n" + esac + printf "$result\n" + done } -mpvc_curl_cache_metadata_json() { - for i in "$@"; do mpvc_curl_cache_metadata_json_once "$i"; done +mpvc_ytquery_json() { + mpvc_ytquery_json_once "$@" } # fn args: given a file/url return its title (may use curl to query YT) -mpvc_curl_cache_title_clean() { - mpvc_curl_cache_metadata_json "$@" | mpvc_getjson 'title' +mpvc_ytquery() { + mpvc_ytquery_json "$@" | mpvc_getjson 'title' } mpvc_getjson() { @@ -321,7 +324,7 @@ mpvc_get_playlist_filename() { if [ "$lid" = "current" ]; then lid=$(mpvc_get playlist-pos); fi filename=$(mpvc_get "playlist/$lid/filename") result=$filename - if [ "$full" != "full" ]; then result=$(mpvc_curl_cache_title_clean "$filename"); fi + if [ "$full" != "full" ]; then result=$(mpvc_ytquery "$filename"); fi result="${result:-${filename%%*/}}" echo "$result" } @@ -339,8 +342,9 @@ mpvc_get_playlist() { fi #mpvc_isinteractive=""; if [ -t 1 ]; then mpvc_isinteractive=1; fi + pct=$(mpvc_cmd expand-text '${percent-pos}') mpvc_get_playlist_once | - awk -v mpvc="$0" -v lpos="$lpos" -v cols="$(mpvc_tty_cols)" -v firstlast="$firstlast" \ + awk -v mpvc="$0" -v pct="$pct" -v lpos="$lpos" -v cols="$(mpvc_tty_cols)" -v firstlast="$firstlast" \ ' BEGIN { # truncate lines x cols when interactive (configurable) TBD @@ -394,27 +398,20 @@ mpvc_get_playlist() { next } + title=mpvc_ytquery($0) + line=sprintf("%2d %s", lid, truncate(title)) if (lpos == lid) { - if (ENVIRON["NO_COLOR"]) - { - title=mpvc_ytquery($0) - printf("%2d %s\n", lid, title) - } - else + if (!ENVIRON["NO_COLOR"]) { - mpvc " cmd expand-text \\${percent-pos}" | getline pct count=int((cols) * (pct/100)) - title=mpvc_ytquery($0) - line=sprintf("%2d %s", lid, truncate(title)) fmtstr="\033[7m%-"count"s\033[0m\n" - printf(fmtstr, line) } + printf(fmtstr, line) } else { - title=mpvc_ytquery($0) - printf("%2d %s\n", lid, truncate(title)) + print line } } ' @@ -565,7 +562,7 @@ mpvc_appendtrack() { # cache media here if media is found in local storage if [ "$MPVC_LOCAL_CACHE" = "true" ]; then filename=$(echo "$filename" | $PROGDIR/mpvc-fzf -C); fi mpvc_ecmdr "loadfile" "$filename" "append-play" || return 1 - quietcheck warn "Adding: $(mpvc_curl_cache_title_clean "$filename")" + quietcheck warn "Adding: $(mpvc_ytquery "$filename")" fi } @@ -1107,8 +1104,8 @@ main() { --filename|filename) shift; mpvc_get_playlist_filename "$@"; return;; --replay|replay) mpvc_set_time "absolute" 0 ;; - ytquery) shift; mpvc_curl_cache_title_clean "$@"; return;; - ytqueryjson) shift; mpvc_curl_cache_metadata_json "$@"; return;; + ytquery) shift; mpvc_ytquery "$@"; return;; + ytqueryjson) shift; mpvc_ytquery_json "$@"; return;; cprev|--chapter-prev|chapter-prev) mpvc_chapter_set +1 "relative" ;; cnext|--chapter-next|chapter-next) mpvc_chapter_set -1 "relative" ;; From 1d0cf0a965bea8f4aa56b342e0487db3e14c4cee Mon Sep 17 00:00:00 2001 From: gmt4 <791491+gmt4@users.noreply.github.com> Date: Mon, 28 Oct 2024 09:30:00 +0100 Subject: [PATCH 037/122] docs: Update docs/logbook.html --- docs/logbook.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/logbook.html b/docs/logbook.html index 24da8703..13bdfc8d 100644 --- a/docs/logbook.html +++ b/docs/logbook.html @@ -71,9 +71,9 @@
While using mpvc-tui
, one ends up wanting to configure the minimal look and feel that mpvc-tui provides. To this end the file mpvc.conf
under $XDG_CONFIG_HOME/mpvc/ provides a place to overwrite the default settings of mpvc-tui.
- Last-Modified: Thursday, 29 February 2023 by gmt4 + π Tue, 19 Now 2024 by gmt4 - Powered by #HTML 𧑠π π + β‘ PoweredBy #HTML
+