This commit is contained in:
2023-12-20 16:14:39 +01:00
parent ab3cf72b69
commit c4c9ed3ec1
2 changed files with 39 additions and 4 deletions

View File

@@ -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