summaryrefslogtreecommitdiff
path: root/lib/action/Rip
diff options
context:
space:
mode:
Diffstat (limited to 'lib/action/Rip')
-rwxr-xr-xlib/action/Rip19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/action/Rip b/lib/action/Rip
new file mode 100755
index 0000000..fbdc0e0
--- /dev/null
+++ b/lib/action/Rip
@@ -0,0 +1,19 @@
+#! /bin/bash
+
+source ./util/menu/deasy
+source ./util/notify
+source ./util/dpath
+
+query="$(deasy "$1" 'Rip Query')"
+result="$(spotdl download "$query" --output "$DPATH" --no-cache)"
+
+if [[ "$result" =~ .*'No song matches found'.* ]]
+ then
+ notify 'Empty Response'
+elif [[ "$result" =~ .*'already downloaded'.* ]]
+ then
+ notify 'Already Downloaded'
+fi
+
+exit 0
+