From c4c9ed3ec11e88be6e0738bf39611cc0417f4134 Mon Sep 17 00:00:00 2001 From: scossa Date: Wed, 20 Dec 2023 16:14:39 +0100 Subject: [PATCH] update --- README.md | 30 ++++++++++++++++++++++++++++++ script.sh | 13 +++++++++---- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e69de29..cb1dc3c 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,30 @@ +## Player Snacast da link YouTube + + utilizza yt-dlp e ffmpeg per scaricare e riprodurre la musica su snapcast utilizzando il cat sul /tmp/snapfifo
+ prevede l'utilizzo di uno snapserver (apt install snapserver) e di uno o piu client Andoid (snapcast) o desktop (snapclient). + + ----------------------------------- + +## USA LO SCRIPT + +Per utilizzare questo script non รจ necessario aver installato sulla stessa macchina un client o un server snapcast. Funzionando anche solo come riproduore.
+ +Scarica il git +```bash +#Scarica il git +git clone https://repo.esiliati.org/scossa/snaptube.git +#Entra nella cartella di scrapeje +cd snaptube +``` + +Installa requirement +```bash +#Concedi i permessi di esecuzione +chmod +x ./snaptube.sh +``` + +Lancia lo script +```bash +#Esegui snaptube +./snaptube.sh +``` diff --git a/script.sh b/script.sh index 7212d2a..73e4f39 100755 --- a/script.sh +++ b/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