aboutsummaryrefslogtreecommitdiffstats
path: root/hm
diff options
context:
space:
mode:
Diffstat (limited to 'hm')
-rw-r--r--hm/soispha/pkgs/scripts.nix1
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/ytc12
2 files changed, 9 insertions, 4 deletions
diff --git a/hm/soispha/pkgs/scripts.nix b/hm/soispha/pkgs/scripts.nix
index e9c70966..a4cab3d4 100644
--- a/hm/soispha/pkgs/scripts.nix
+++ b/hm/soispha/pkgs/scripts.nix
@@ -206,6 +206,7 @@
mpv
ffmpeg
gnused
+ gawk
;
};
};
diff --git a/hm/soispha/pkgs/scripts/wrappers/ytc b/hm/soispha/pkgs/scripts/wrappers/ytc
index ce7f9ba9..7e806449 100755
--- a/hm/soispha/pkgs/scripts/wrappers/ytc
+++ b/hm/soispha/pkgs/scripts/wrappers/ytc
@@ -6,7 +6,7 @@ CONCURRENT=4
OUTPUT_PATH="/tmp/ytcc";
col() {
- echo "$1" | csvtool col "$2" -
+ echo "$1" | csvtool -t ';' col "$2" -
}
play() {
@@ -23,7 +23,11 @@ play() {
return "$output"
}
-bases="$(ytcc --output json list --attributes url --ids "$@" | jq --raw-output 'map("\(.url),\(.id)") | join("\n")')";
+escape() {
+ echo "$1" | awk '{gsub(/;/, ","); print}'
+}
+
+bases="$(ytcc --output json list --attributes url --ids "$@" | jq --raw-output 'map("\(.url);\(.id)") | join("\n")')";
yt_flags="$(mktmp)"
cat << EOF > "$yt_flags"
@@ -47,7 +51,7 @@ while read -r base; do
id="$(col "$base" 2)"
if [ "$old_filename" ]; then
- echo "$old_filename,$old_id" >> "$files_to_play"
+ echo "$(escape "$old_filename");$old_id" >> "$files_to_play"
# Check if the process (pid) exists
dbg "PID is '$pid'"
@@ -84,7 +88,7 @@ while read -r base; do
done < "$(tmp echo "$bases")"
wait "$pid"
-echo "$old_filename,$old_id" >> "$files_to_play"
+echo "$(escape "$old_filename");$old_id" >> "$files_to_play"
while read -r base; do
name="$(col "$base" 1)";