SAISON fool proof
This commit is contained in:
parent
52dbd575b7
commit
f535f7144c
|
@ -105,10 +105,15 @@ if [[ $1 == "on" ]]; then
|
||||||
REP=$(~/.zen/Astroport.ONE/tools/cron_VRFY.sh ON) && zenity --warning --width 600 --text "$REP"
|
REP=$(~/.zen/Astroport.ONE/tools/cron_VRFY.sh ON) && zenity --warning --width 600 --text "$REP"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
espeak "restart IPFS daemon"
|
||||||
|
sudo systemctl restart ipfs
|
||||||
|
|
||||||
## CHECK IF ASTROPORT/CRON/IPFS IS RUNNING
|
## CHECK IF ASTROPORT/CRON/IPFS IS RUNNING
|
||||||
YOU=$(ipfs swarm peers >/dev/null 2>&1 && echo "$USER" || ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
YOU=$(ipfs swarm peers >/dev/null 2>&1 && echo "$USER" || ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
||||||
[[ ! $YOU ]] && espeak "I P F S not running - EXIT" && exit 1
|
[[ ! $YOU ]] && espeak "I P F S not running - EXIT" && exit 1
|
||||||
|
|
||||||
|
espeak "Ready !"
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# CHOOSE CATEGORY (remove anime, not working!)
|
# CHOOSE CATEGORY (remove anime, not working!)
|
||||||
[[ $CHOICE == "" ]] && CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre media" --entry-text="Vlog" Film Serie Youtube Video)
|
[[ $CHOICE == "" ]] && CHOICE=$(zenity --entry --width 300 --title="Catégorie" --text="Choisissez la catégorie de votre media" --entry-text="Vlog" Film Serie Youtube Video)
|
||||||
|
@ -426,7 +431,7 @@ RES=${FILE_RES%?}0p # Rounding. Replace last digit with 0
|
||||||
# VIDEO SEASON or SAGA
|
# VIDEO SEASON or SAGA
|
||||||
[[ "${CAT}" == "serie" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saison" --text "Indiquez SAISON et EPISODE. Exemple: S02E05" --entry-text="")
|
[[ "${CAT}" == "serie" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saison" --text "Indiquez SAISON et EPISODE. Exemple: S02E05" --entry-text="")
|
||||||
[[ "${CAT}" == "film" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saga" --text "Indiquez une SAGA (optionnel). Exemple: James Bond" --entry-text="")
|
[[ "${CAT}" == "film" ]] && SAISON=$(zenity --entry --width 300 --title "${CHOICE} Saga" --text "Indiquez une SAGA (optionnel). Exemple: James Bond" --entry-text="")
|
||||||
[[ $SAISON ]] && SAISON=" - $SAISON"
|
[[ $SAISON ]] && SAISON="_$SAISON"
|
||||||
|
|
||||||
# VIDEO GENRES
|
# VIDEO GENRES
|
||||||
FILM_GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut}\
|
FILM_GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut}\
|
||||||
|
@ -478,11 +483,9 @@ FILM_GENRES=$(zenity --list --checklist --title="GENRE" --height=${haut}\
|
||||||
GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]"
|
GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]"
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Screen capture is used as thumbnail
|
# Screen capture
|
||||||
########################################################################
|
########################################################################
|
||||||
if [[ $(echo $DISPLAY | cut -d ':' -f 1) == "" ]]; then
|
if [[ $(echo $DISPLAY | cut -d ':' -f 1) == "" ]]; then
|
||||||
zenity --warning --width 300 --text "Cliquez nous capturons votre écran comme vignette MEDIA"
|
|
||||||
sleep 1
|
|
||||||
import -window root /tmp/screen.png
|
import -window root /tmp/screen.png
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -562,7 +565,7 @@ echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/i
|
||||||
esac
|
esac
|
||||||
|
|
||||||
## Extract thumbnail
|
## Extract thumbnail
|
||||||
MIME=$(file --mime-type -b $HOME/astroport/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT})
|
MIME=$(file --mime-type -b "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT}")
|
||||||
|
|
||||||
[[ $(echo $MIME | grep video) ]] && ffmpeg -i $HOME/astroport/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT} -r 1/300 -vf scale=-1:120 -vcodec png $HOME/astroport/${CAT}/${MEDIAID}/thumbnail.png
|
[[ $(echo $MIME | grep video) ]] && ffmpeg -i $HOME/astroport/${CAT}/${MEDIAID}/${TITLE}${SAISON}.${FILE_EXT} -r 1/300 -vf scale=-1:120 -vcodec png $HOME/astroport/${CAT}/${MEDIAID}/thumbnail.png
|
||||||
[[ ! -f ~/astroport/${CAT}/${MEDIAID}/thumbnail.png ]] && echo "DEFAULT THUMBNAIL NEEDED"
|
[[ ! -f ~/astroport/${CAT}/${MEDIAID}/thumbnail.png ]] && echo "DEFAULT THUMBNAIL NEEDED"
|
||||||
|
|
|
@ -48,14 +48,15 @@ fi
|
||||||
mkdir -p ~/.zen/tmp/
|
mkdir -p ~/.zen/tmp/
|
||||||
|
|
||||||
espeak "Hello"
|
espeak "Hello"
|
||||||
espeak "Getting player latest TW. please wait."
|
if [[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/_g1.pubkey ]]; then
|
||||||
## GETTING LAST TW via IPFS or HTTP GW
|
espeak "Getting player latest TW. please wait."
|
||||||
[[ $YOU ]] && echo "http://$myIP:8080/ipns/${ASTRONAUTENS} ($YOU)" && ipfs --timeout 6s cat /ipns/${ASTRONAUTENS} > ~/.zen/tmp/vlc_webcam.html
|
## GETTING LAST TW via IPFS or HTTP GW
|
||||||
[[ ! -s ~/.zen/tmp/vlc_webcam.html ]] && echo "$LIBRA/ipns/${ASTRONAUTENS}" && curl -m 6 -so ~/.zen/tmp/vlc_webcam.html "$LIBRA/ipns/${ASTRONAUTENS}"
|
[[ $YOU ]] && echo "http://$myIP:8080/ipns/${ASTRONAUTENS} ($YOU)" && ipfs --timeout 12s cat /ipns/${ASTRONAUTENS} > ~/.zen/tmp/vlc_webcam.html
|
||||||
[[ ! -s ~/.zen/tmp/vlc_webcam.html ]] && espeak "WARNING. impossible to find your TW online"
|
[[ ! -s ~/.zen/tmp/vlc_webcam.html ]] && echo "$LIBRA/ipns/${ASTRONAUTENS}" && curl -m 12 -so ~/.zen/tmp/vlc_webcam.html "$LIBRA/ipns/${ASTRONAUTENS}"
|
||||||
[[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ]] && espeak "FATAL ERROR. No local copy found !" && exit 1
|
[[ ! -s ~/.zen/tmp/vlc_webcam.html ]] && espeak "WARNING. impossible to find your TW online"
|
||||||
[[ -s ~/.zen/tmp/vlc_webcam.html ]] && cp -f ~/.zen/tmp/vlc_webcam.html ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html && espeak "OK DONE"
|
[[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ]] && espeak "FATAL ERROR. No local copy found !" && exit 1
|
||||||
|
[[ -s ~/.zen/tmp/vlc_webcam.html ]] && cp -f ~/.zen/tmp/vlc_webcam.html ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html && espeak "OK DONE"
|
||||||
|
fi
|
||||||
espeak "Start Video recording. Press ENTER to stop !"
|
espeak "Start Video recording. Press ENTER to stop !"
|
||||||
# Find "input-slave" :: pactl list short sources
|
# Find "input-slave" :: pactl list short sources
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue