]> gitweb.morketsmerke.org Git - immudex-testing.git/commitdiff
Dodanie brakującego tool-a
authorxf0r3m <jakubstasinski@protonmail.com>
Fri, 9 Jun 2023 10:16:08 +0000 (12:16 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Fri, 9 Jun 2023 10:16:08 +0000 (12:16 +0200)
tools/100/pl [new file with mode: 0755]

diff --git a/tools/100/pl b/tools/100/pl
new file mode 100755 (executable)
index 0000000..efcd0b0
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+file=$1;
+
+function help() {
+  echo "pl - Play Links. Skrypt to odtwarzania multimediów z listy linków";
+  echo "morketsmerke.org; COPYLEFT; 2023";
+  echo;
+  echo "Użycie:";
+  echo "$ pl sciezka/do/listy/linkow";
+  echo;
+  echo "Format listy:";
+  echo "nazwa linku: https://youtube.com/...";
+}
+
+if [ "$1" ]; then 
+  PS3="Link: ";
+  linkNames=$(cut -d ":" -f 1 $1 | sed 's/\ /_/g' | awk '{printf $1" "}')
+  select name in $linkNames; do
+    if [ ! "$name" ]; then break; fi
+    linkName=$(echo $name | sed 's/_/\ /g');
+    link=$(grep "$linkName" $file | cut -d ":" -f 2-);
+    if echo $link | grep -q "youtube"; then
+      ytplay -a $link -f best[height=360];
+    else
+      mpv --no-video $link;
+    fi
+  done
+else
+  help;
+  exit 1;
+fi