aboutsummaryrefslogtreecommitdiffstats
path: root/hm/soispha/pkgs/scripts/wrappers
diff options
context:
space:
mode:
Diffstat (limited to 'hm/soispha/pkgs/scripts/wrappers')
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/ytc12
1 files changed, 8 insertions, 4 deletions
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)";