update
This commit is contained in:
13
script.sh
13
script.sh
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#RIPRODUTTORE SNAPCAST DA LINK YOUTUBE
|
||||
#set -xu
|
||||
#set -xu #per debug
|
||||
cnt=0
|
||||
|
||||
trappola() {
|
||||
@@ -10,15 +10,17 @@ trappola() {
|
||||
trap trappola SIGINT
|
||||
|
||||
|
||||
|
||||
#Crea dir 'songs' se non esiste
|
||||
if [ ! -d "songs" ]; then
|
||||
mkdir songs
|
||||
fi
|
||||
|
||||
#Inizializza playlist
|
||||
clear
|
||||
rm /tmp/snapfifo
|
||||
touch /tmp/snapfifo
|
||||
echo -e "\nPlaylist riprodotta:" >> songs/playlist.txt
|
||||
|
||||
2
|
||||
while :
|
||||
do
|
||||
|
||||
@@ -28,10 +30,13 @@ do
|
||||
|
||||
echo -e '\e[37m- Player YouTube snapcast -'
|
||||
echo -e "\033[90mDigita 'off' per chiudere"
|
||||
read -p $'\033[97mLink \033[0;31mYoutube\033[97m: ' userInput
|
||||
read -p $'\033[97mLink \033[0;31mYoutube\033[97m: ' userInput
|
||||
#userInput='https://www.youtube.com/watch?v=jm56jeM2b_Y' #per debug
|
||||
|
||||
#Scarica audio da link YT
|
||||
if [ "$userInput" = "off" ]; then
|
||||
rm songs/play.wav
|
||||
rm /tmp/snapfifo; touch /tmp/snapfifo
|
||||
pkill ffmpeg
|
||||
break
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user