diff --git a/ajouter_video.sh b/ajouter_video.sh index 2cf6a95..0b91902 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -45,7 +45,7 @@ IPFSNODEID=$(ipfs id -f='\n') zenity --warning --width 300 --text "Ajoutez une vidéo à ASTROPORT/KODI" # CHOOSE CATEGORY -CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre vidéo" --entry-text="Film" Serie Anime Youtube) +CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre vidéo" --entry-text="Film" Serie Anime Youtube MP3) [[ $CHOICE == "" ]] && exit 1 # LOWER CARACTERS @@ -108,11 +108,13 @@ artist=$(zenity --entry --width 300 --title "Extraction MP3 depuis Youtube" --te ## CHECK if artist is LINK or ID length=${#artist} islink=$(echo "$artist" | grep "http") -if [[ ! $islink || $length != 11 ]] +if [[ ! $islink && $length != 11 ]] then # Ask for song name song=$(zenity --entry --width 300 --title "Titre à chercher sur Youtube" --text "Titre recherché" --entry-text="") [[ $song == "" ]] && exit 1 +else + song="" fi # Download mp3 from 1st youtube search video result @@ -129,7 +131,7 @@ FILE_EXT="${FILE_NAME##*.}" YID=$(echo "${FILE_NAME}" | cut -d "_" -f 1) YNAME=$(echo "${FILE_NAME}" | cut -d "_" -f 2) -FILE_PATH="$HOME/astroport/$CAT/$artist/" +FILE_PATH="$HOME/astroport/$CAT/$artist/$song" mkdir -p ${FILE_PATH} && mv ${YTEMP}/* ${FILE_PATH}/ TMDB=$YID