woooo
This commit is contained in:
parent
92e03a936d
commit
2e9df3d0f5
24
12345.sh
24
12345.sh
|
@ -69,8 +69,8 @@ while true; do
|
||||||
# RESET VARIABLES
|
# RESET VARIABLES
|
||||||
SALT=""; PEPPER=""; TYPE=""
|
SALT=""; PEPPER=""; TYPE=""
|
||||||
echo "************************************************************************* "
|
echo "************************************************************************* "
|
||||||
echo "ASTROPORT API SERVER UP.......................... http://$myIP:1234 PORT"
|
echo "ASTROPORT 1234 UP & RUNNING.......................... http://$myIP:1234 PORT"
|
||||||
echo "$MOATS LANDING PAGE http://$myIP:${PORT}"
|
echo "$MOATS NEXT COMMAND DELIVERY PAGE http://$myIP:${PORT}"
|
||||||
|
|
||||||
############### ############### ############### ############### templates/index.http
|
############### ############### ############### ############### templates/index.http
|
||||||
# REPLACE myIP in http response template (fixing next API meeting point)
|
# REPLACE myIP in http response template (fixing next API meeting point)
|
||||||
|
@ -159,28 +159,28 @@ sed -i "s~_HOSTNAME_~$(hostname)~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
## ARCHIVE TOCTOC WHATS & KEEPS LOGS CLEAN
|
## ARCHIVE TOCTOC WHATS & KEEPS LOGS CLEAN
|
||||||
mkdir -p ~/.zen/game/players/toctoc/
|
mkdir -p ~/.zen/game/players/.toctoc/
|
||||||
ISTHERE=$(ls -t ~/.zen/game/players/toctoc/*.${G1PUB}.ipns.key 2>/dev/null | tail -n 1)
|
ISTHERE=$(ls -t ~/.zen/game/players/.toctoc/*.${G1PUB}.ipns.key 2>/dev/null | tail -n 1)
|
||||||
TTIME=$(echo $ISTHERE | rev | cut -d '.' -f 4 | cut -d '/' -f 1 | rev)
|
TTIME=$(echo $ISTHERE | rev | cut -d '.' -f 4 | cut -d '/' -f 1 | rev)
|
||||||
if [[ ! $ISTHERE ]]; then
|
if [[ ! $ISTHERE ]]; then
|
||||||
echo "WHAT 1ST TOCTOC : $MOATS"
|
echo "WHAT 1ST TOCTOC : $MOATS"
|
||||||
cp ~/.zen/tmp/coucou/${MOATS}.* ~/.zen/game/players/toctoc/
|
cp ~/.zen/tmp/coucou/${MOATS}.* ~/.zen/game/players/.toctoc/
|
||||||
else ## KEEP 1ST CONTACT ONLY
|
else ## KEEP 1ST CONTACT ONLY
|
||||||
OLDONE=$(ls -t ~/.zen/tmp/coucou/*.${G1PUB}.ipns.key | tail -n 1)
|
OLDONE=$(ls -t ~/.zen/tmp/coucou/*.${G1PUB}.ipns.key | tail -n 1)
|
||||||
DTIME=$(echo $OLDONE | rev | cut -d '.' -f 4 | cut -d '/' -f 1 | rev)
|
DTIME=$(echo $OLDONE | rev | cut -d '.' -f 4 | cut -d '/' -f 1 | rev)
|
||||||
[[ $DTIME != $MOATS ]] && rm ~/.zen/tmp/coucou/$DTIME.*
|
[[ $DTIME != $MOATS ]] && rm ~/.zen/tmp/coucou/$DTIME.*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## TYPE SLECTION ########################
|
## TYPE SLECTION ########################
|
||||||
# MESSAGING
|
# MESSAGING
|
||||||
if [[ $TYPE == "messaging" ]]; then
|
if [[ $TYPE == "messaging" ]]; then
|
||||||
|
(
|
||||||
echo "Extracting ${G1PUB} messages..."
|
echo "Extracting ${G1PUB} messages..."
|
||||||
~/.zen/Astroport.ONE/tools/timeout.sh -t 3 \
|
~/.zen/Astroport.ONE/tools/timeout.sh -t 12 \
|
||||||
${MY_PATH}/tools/jaklis/jaklis.py -k ~/.zen/tmp/coucou/${MOATS}.secret.key read -n 10 -j > ~/.zen/tmp/coucou/messin.${G1PUB}.json
|
${MY_PATH}/tools/jaklis/jaklis.py -k ~/.zen/tmp/coucou/${MOATS}.secret.key read -n 10 -j > ~/.zen/tmp/coucou/messin.${G1PUB}.json
|
||||||
[[ ! -s ~/.zen/tmp/coucou/messin.${G1PUB}.json || $(grep -v -E 'Aucun message à afficher' ~/.zen/tmp/coucou/messin.${G1PUB}.json) == "True" ]] && echo "[]" > ~/.zen/tmp/coucou/messin.${G1PUB}.json
|
[[ ! -s ~/.zen/tmp/coucou/messin.${G1PUB}.json || $(grep -v -E 'Aucun message à afficher' ~/.zen/tmp/coucou/messin.${G1PUB}.json) == "True" ]] && echo "[]" > ~/.zen/tmp/coucou/messin.${G1PUB}.json
|
||||||
|
|
||||||
~/.zen/Astroport.ONE/tools/timeout.sh -t 3 \
|
~/.zen/Astroport.ONE/tools/timeout.sh -t 12 \
|
||||||
${MY_PATH}/tools/jaklis/jaklis.py -k ~/.zen/tmp/coucou/${MOATS}.secret.key read -n 10 -j -o > ~/.zen/tmp/coucou/messout.${G1PUB}.json
|
${MY_PATH}/tools/jaklis/jaklis.py -k ~/.zen/tmp/coucou/${MOATS}.secret.key read -n 10 -j -o > ~/.zen/tmp/coucou/messout.${G1PUB}.json
|
||||||
[[ ! -s ~/.zen/tmp/coucou/messout.${G1PUB}.json || $(grep -v -E 'Aucun message à afficher' ~/.zen/tmp/coucou/messout.${G1PUB}.json) == "True" ]] && echo "[]" > ~/.zen/tmp/coucou/messout.${G1PUB}.json
|
[[ ! -s ~/.zen/tmp/coucou/messout.${G1PUB}.json || $(grep -v -E 'Aucun message à afficher' ~/.zen/tmp/coucou/messout.${G1PUB}.json) == "True" ]] && echo "[]" > ~/.zen/tmp/coucou/messout.${G1PUB}.json
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ sed -i "s~_HOSTNAME_~$(hostname)~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect
|
||||||
## ADDING HTTP/1.1 PROTOCOL HEADER
|
## ADDING HTTP/1.1 PROTOCOL HEADER
|
||||||
echo "HTTP/1.1 200 OK
|
echo "HTTP/1.1 200 OK
|
||||||
Server: Astroport
|
Server: Astroport
|
||||||
Content-Type: text/html; charset=UTF-8
|
Content-Type: application/json; charset=UTF-8
|
||||||
" > ~/.zen/tmp/coucou/${MOATS}.index.redirect
|
" > ~/.zen/tmp/coucou/${MOATS}.index.redirect
|
||||||
cat ~/.zen/tmp/coucou/${MOATS}.messaging.json >> ~/.zen/tmp/coucou/${MOATS}.index.redirect
|
cat ~/.zen/tmp/coucou/${MOATS}.messaging.json >> ~/.zen/tmp/coucou/${MOATS}.index.redirect
|
||||||
|
|
||||||
|
@ -203,6 +203,10 @@ cat ~/.zen/tmp/coucou/${MOATS}.messaging.json >> ~/.zen/tmp/coucou/${MOATS}.inde
|
||||||
### echo "SESSION http://$myIP:8080/ipns/$SESSIONNS "
|
### echo "SESSION http://$myIP:8080/ipns/$SESSIONNS "
|
||||||
|
|
||||||
cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
|
cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
|
||||||
|
end=`date +%s`
|
||||||
|
echo Execution time was `expr $end - $start` seconds.
|
||||||
|
) &
|
||||||
|
|
||||||
end=`date +%s`
|
end=`date +%s`
|
||||||
echo Execution time was `expr $end - $start` seconds.
|
echo Execution time was `expr $end - $start` seconds.
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -15,7 +15,7 @@ echo "## RUNNING PLAYER.refresh"
|
||||||
|
|
||||||
## RUNING FOR ALL LOCAL PLAYERS
|
## RUNING FOR ALL LOCAL PLAYERS
|
||||||
for PLAYER in $(ls -t ~/.zen/game/players/); do
|
for PLAYER in $(ls -t ~/.zen/game/players/); do
|
||||||
[[ $PLAYER == 'toctoc' ]] && echo "toctoc" && continue
|
[[ $PLAYER == '.toctoc' ]] && echo ".toctoc users " && continue
|
||||||
echo "##################################################################"
|
echo "##################################################################"
|
||||||
echo ">>>>> PLAYER : $PLAYER >>>>>>>>>>>>> REFRESHING TW STATION"
|
echo ">>>>> PLAYER : $PLAYER >>>>>>>>>>>>> REFRESHING TW STATION"
|
||||||
echo "##################################################################"
|
echo "##################################################################"
|
||||||
|
|
|
@ -29,19 +29,27 @@ ME="${0##*/}"
|
||||||
[[ $(which xdpyinfo) == "" ]] && echo "ERREUR! Installez x11-utils" && echo "sudo apt install x11-utils" && exit 1
|
[[ $(which xdpyinfo) == "" ]] && echo "ERREUR! Installez x11-utils" && echo "sudo apt install x11-utils" && exit 1
|
||||||
|
|
||||||
# Check who is .current PLAYER
|
# Check who is .current PLAYER
|
||||||
PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 )
|
PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null)
|
||||||
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 )
|
[[ $PLAYER == "" ]] && espeak "ERROR CONNECT YOUR PLAYER - EXIT" && exit 1
|
||||||
G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 )
|
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null)
|
||||||
|
G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null)
|
||||||
|
[[ $G1PUB == "" ]] && espeak "ERROR NO G1 PUBLIC KEY FOUND - EXIT" && exit 1
|
||||||
|
|
||||||
PLAYERNS=$(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) || ( echo "noplayerns" && exit 1 )
|
PLAYERNS=$(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) || ( echo "noplayerns" && exit 1 )
|
||||||
|
|
||||||
ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
|
ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
|
||||||
[[ $ASTRONAUTENS == "" ]] && echo "ASTRONAUTE manquant" && exit 1
|
[[ $ASTRONAUTENS == "" ]] && echo "ASTRONAUTE manquant" && espeak "Astronaut Key Missing" && exit 1
|
||||||
|
|
||||||
|
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
||||||
|
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
|
||||||
|
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
|
||||||
|
|
||||||
URL="$1"
|
URL="$1"
|
||||||
if [ $URL ]; then
|
if [ $URL ]; then
|
||||||
echo "URL: $URL"
|
echo "URL: $URL"
|
||||||
REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_"
|
REVSOURCE="$(echo "$URL" | awk -F/ '{print $3}' | rev)_"
|
||||||
[ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Que copier depuis cette source ?" --entry-text="Video" MP3 Web) || IMPORT="Youtube"
|
[ ! $2 ] && IMPORT=$(zenity --entry --width 640 --title="$URL => Astroport" --text="Que copier depuis cette source ?" --entry-text="Page" Video MP3 Web)
|
||||||
|
[[ $IMPORT == "" ]] && espeak "No choice made. Exiting program" && exit 1
|
||||||
[[ $IMPORT == "Video" ]] && IMPORT="Youtube"
|
[[ $IMPORT == "Video" ]] && IMPORT="Youtube"
|
||||||
CHOICE="$IMPORT"
|
CHOICE="$IMPORT"
|
||||||
fi
|
fi
|
||||||
|
@ -59,9 +67,6 @@ height=$(echo $screen | cut -d 'x' -f 2)
|
||||||
large=$((width-300))
|
large=$((width-300))
|
||||||
haut=$((height-200))
|
haut=$((height-200))
|
||||||
|
|
||||||
########################################################################
|
|
||||||
PLAYER=$(cat ~/.zen/game/players/.current/.player)
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
## CADRE EXCEPTION COPIE PRIVE
|
## CADRE EXCEPTION COPIE PRIVE
|
||||||
# https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/
|
# https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000006278917/2008-12-11/
|
||||||
|
@ -90,25 +95,23 @@ case $? in
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## CHECK IF ASTROPORT/CRON/IPFS IS RUNNING
|
|
||||||
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
|
||||||
[[ ! $YOU ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS OFF" --text="Activer Astroport ?" --entry-text="OUI" NON) && [[ $RUN == "" || $RUN == "NON" ]] && exit 1
|
|
||||||
[[ $YOU && ! $1 ]] && RUN=$(zenity --entry --width 300 --title="Astroport IPFS ON" --text="Désactiver Astroport ? Non, vous voulez ajouter un Media?" --entry-text="OUI" NON)
|
|
||||||
## DES/ACTIVATION ASTROPORT
|
## DES/ACTIVATION ASTROPORT
|
||||||
if [[ $RUN == "OUI" ]]; then
|
if [[ $1 == "on" ]]; then
|
||||||
STRAP=$(ipfs bootstrap)
|
STRAP=$(ipfs bootstrap)
|
||||||
BOOT=$(zenity --entry --width 300 --title="Catégorie" --text="$STRAP Changez de Bootstrap" --entry-text="Aucun" astrXbian Public)
|
BOOT=$(zenity --entry --width 300 --title="Catégorie" --text="$STRAP Changez de Bootstrap" --entry-text="Aucun" astrXbian Public)
|
||||||
[[ $BOOT == "Aucun" ]] && ipfs bootstrap rm --all
|
[[ $BOOT == "Aucun" ]] && ipfs bootstrap rm --all
|
||||||
[[ $BOOT == "astrXbian" ]] && for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#"); do ipfs bootstrap add $bootnode; done
|
[[ $BOOT == "astrXbian" ]] && for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#"); do ipfs bootstrap add $bootnode; done
|
||||||
[[ $BOOT == "Public" ]] && for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_public.txt | grep -Ev "#"); do ipfs bootstrap add $bootnode; done
|
[[ $BOOT == "Public" ]] && for bootnode in $(cat ~/.zen/astrXbian/A_boostrap_public.txt | grep -Ev "#"); do ipfs bootstrap add $bootnode; done
|
||||||
REP=$(~/.zen/Astroport.ONE/tools/cron_VRFY.sh) && zenity --warning --width 600 --text "$REP"
|
REP=$(~/.zen/Astroport.ONE/tools/cron_VRFY.sh ON) && zenity --warning --width 600 --text "$REP"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
## CHECK IF ASTROPORT/CRON/IPFS IS RUNNING
|
||||||
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
|
||||||
[[ $YOU == "" ]] && echo "IPFS not running" && exit 1
|
[[ ! $YOU ]] && espeak "I P F S not running - EXIT" && exit 1
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# 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 ajout" --entry-text="Film" Serie Youtube AstroBlog 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)
|
||||||
[[ $CHOICE == "" ]] && exit 1
|
[[ $CHOICE == "" ]] && exit 1
|
||||||
|
|
||||||
# LOWER CARACTERS
|
# LOWER CARACTERS
|
||||||
|
@ -132,10 +135,9 @@ case ${CAT} in
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
########################################################################
|
########################################################################
|
||||||
astroblog)
|
vlog)
|
||||||
|
|
||||||
# INSTASCAN G1PUB CAPTURE
|
espeak "vlog is video blogging"
|
||||||
~/.zen/Astroport.ONE/tools/instascan_login.sh "ONE"
|
|
||||||
|
|
||||||
zenity --warning --width 300 --text "$PLAYER. Prêt à enregistrer votre video ?"
|
zenity --warning --width 300 --text "$PLAYER. Prêt à enregistrer votre video ?"
|
||||||
|
|
||||||
|
@ -156,6 +158,8 @@ case ${CAT} in
|
||||||
########################################################################
|
########################################################################
|
||||||
youtube)
|
youtube)
|
||||||
|
|
||||||
|
espeak "youtube : video copying"
|
||||||
|
|
||||||
YTURL="$URL"
|
YTURL="$URL"
|
||||||
[[ $YTURL == "" ]] && YTURL=$(zenity --entry --width 300 --title "Lien ou identifiant à copier" --text "Indiquez le lien (URL) ou l'ID de la vidéo" --entry-text="")
|
[[ $YTURL == "" ]] && YTURL=$(zenity --entry --width 300 --title "Lien ou identifiant à copier" --text "Indiquez le lien (URL) ou l'ID de la vidéo" --entry-text="")
|
||||||
[[ $YTURL == "" ]] && exit 1
|
[[ $YTURL == "" ]] && exit 1
|
||||||
|
@ -236,8 +240,13 @@ rm -Rf ${YTEMP}
|
||||||
# CASE ## WEB
|
# CASE ## WEB
|
||||||
web)
|
web)
|
||||||
|
|
||||||
|
espeak "web : clone web site. Please help debugging"
|
||||||
|
|
||||||
## wget current URL -> index.html ## TEST ## TEST httrack ??
|
## wget current URL -> index.html ## TEST ## TEST httrack ??
|
||||||
[[ ! $(which httrack) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de site web absent.. Lancez la commande 'sudo apt install httrack'" && exit 1
|
[[ ! $(which httrack) ]] && espeak "Plase install httrack software - EXIT" && \
|
||||||
|
zenity --warning --width ${large} --text "Utilitaire de copie de site web absent.. Lancez la commande 'sudo apt install httrack'" && \
|
||||||
|
exit 1
|
||||||
|
|
||||||
echo "httrack --mirror $URL" # TODO : FOR NOW NOT WORKING
|
echo "httrack --mirror $URL" # TODO : FOR NOW NOT WORKING
|
||||||
FILE_NAME="index.html"
|
FILE_NAME="index.html"
|
||||||
REVSOURCE="$(echo "$URL" | rev | sha256sum | cut -d ' ' -f 1)_"; echo $REVSOURCE # URL="https://discuss.ipfs.io/t/limit-ipfs-get-command/3573/6"
|
REVSOURCE="$(echo "$URL" | rev | sha256sum | cut -d ' ' -f 1)_"; echo $REVSOURCE # URL="https://discuss.ipfs.io/t/limit-ipfs-get-command/3573/6"
|
||||||
|
@ -259,6 +268,8 @@ rm -Rf ${YTEMP}
|
||||||
# CASE ## PAGE
|
# CASE ## PAGE
|
||||||
page)
|
page)
|
||||||
|
|
||||||
|
espeak "page : convert into portable digital document"
|
||||||
|
|
||||||
## record one page to PDF
|
## record one page to PDF
|
||||||
[[ ! $(which chromium) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de page web absent.. Lancez la commande 'sudo apt install chromium'" && exit 1
|
[[ ! $(which chromium) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de page web absent.. Lancez la commande 'sudo apt install chromium'" && exit 1
|
||||||
cd /tmp/ && rm -f output.pdf
|
cd /tmp/ && rm -f output.pdf
|
||||||
|
@ -288,7 +299,10 @@ rm -Rf ${YTEMP}
|
||||||
########################################################################
|
########################################################################
|
||||||
mp3)
|
mp3)
|
||||||
|
|
||||||
zenity --warning --width 600 --text 'WARNING. HEAVY DEBUG ZONE . Join us at https://git.p2p.legal'
|
espeak "mp3 is music copying. Please help..."
|
||||||
|
|
||||||
|
zenity --warning --width 600 --text 'DEVELOPPER ZONE ONLY - https://git.p2p.legal'
|
||||||
|
exit 0
|
||||||
|
|
||||||
# Create TEMP directory
|
# Create TEMP directory
|
||||||
YTEMP="$HOME/.zen/tmp/$(date -u +%s%N | cut -b1-13)"
|
YTEMP="$HOME/.zen/tmp/$(date -u +%s%N | cut -b1-13)"
|
||||||
|
@ -360,6 +374,8 @@ exit 0
|
||||||
########################################################################
|
########################################################################
|
||||||
film | serie)
|
film | serie)
|
||||||
|
|
||||||
|
espeak "thank you for sharing your best movies"
|
||||||
|
|
||||||
# SELECT FILE TO ADD TO ASTROPORT/KODI
|
# SELECT FILE TO ADD TO ASTROPORT/KODI
|
||||||
FILE=$(zenity --file-selection --title="Sélectionner le fichier à ajouter")
|
FILE=$(zenity --file-selection --title="Sélectionner le fichier à ajouter")
|
||||||
echo "${FILE}"
|
echo "${FILE}"
|
||||||
|
@ -494,6 +510,8 @@ echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/i
|
||||||
|
|
||||||
video)
|
video)
|
||||||
|
|
||||||
|
epeak "video is adding your personnal video in TW"
|
||||||
|
|
||||||
zenity --warning --width 600 --text 'DEVELOPPEMENT. SVP. Inscrivez-vous sur https://git.p2p.legal'
|
zenity --warning --width 600 --text 'DEVELOPPEMENT. SVP. Inscrivez-vous sur https://git.p2p.legal'
|
||||||
|
|
||||||
## GENERAL MEDIAKEY for uploaded video. Title + Decription + hashtag + hashipfs
|
## GENERAL MEDIAKEY for uploaded video. Title + Decription + hashtag + hashipfs
|
||||||
|
@ -625,20 +643,9 @@ zenity --warning --width 300 --text "Ajout du Tiddler $MEDIAKEY à votre TW 'moa
|
||||||
########################################################################
|
########################################################################
|
||||||
## ADD TIDDLER TO TW
|
## ADD TIDDLER TO TW
|
||||||
########################################################################
|
########################################################################
|
||||||
VOEUXLIST=($(cat /home/fred/.zen/game/players/.current/voeux/*/.title)) # LIST PLAYER VOEUX
|
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||||
echo "${VOEUXLIST}"
|
###############################
|
||||||
# TODO : Make it work Add FALSE between each voeu in VOEUXLIST
|
echo "Nouveau MEDIAKEY dans TW $PSEUDO / $PLAYER : http://$myIP:8080/ipns/$ASTRONAUTENS"
|
||||||
# VCHOOSE=$(zenity --list --checklist --title="VOEUX"\
|
|
||||||
# --text="Choisissez le voeux ou ajouter \"${TITLE}\""\
|
|
||||||
# --column="Use"\
|
|
||||||
# --column="Feature"\
|
|
||||||
# ${VOEUXLIST})
|
|
||||||
## CHOOSE VOEU TW
|
|
||||||
## ADD TIDDLER TO VOEUTW
|
|
||||||
## ADD VOEUTW TO IPFS...
|
|
||||||
## OR ADD TO PLAYER TW
|
|
||||||
## TODO MAKE FUNCTION, idem dans G1VOEUX !!
|
|
||||||
echo "Nouveau MEDIAKEY dans MOA $PSEUDO / $PLAYER : http://127.0.0.1:8080/ipns/$ASTRONAUTENS"
|
|
||||||
tiddlywiki --verbose --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html \
|
tiddlywiki --verbose --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html \
|
||||||
--import ~/astroport/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json "application/json" \
|
--import ~/astroport/${CAT}/${MEDIAID}/${MEDIAKEY}.dragdrop.json "application/json" \
|
||||||
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
|
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
|
||||||
|
@ -647,7 +654,6 @@ echo "${VOEUXLIST}"
|
||||||
if [[ -s ~/.zen/tmp/newindex.html ]]; then
|
if [[ -s ~/.zen/tmp/newindex.html ]]; then
|
||||||
echo "Mise à jour ~/.zen/game/players/$PLAYER/ipfs/moa/index.html"
|
echo "Mise à jour ~/.zen/game/players/$PLAYER/ipfs/moa/index.html"
|
||||||
cp -f ~/.zen/tmp/newindex.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
|
cp -f ~/.zen/tmp/newindex.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
|
||||||
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
|
||||||
echo "Avancement blockchain TW $PLAYER : $MOATS"
|
echo "Avancement blockchain TW $PLAYER : $MOATS"
|
||||||
cp ~/.zen/game/players/$PLAYER/ipfs/moa/.chain ~/.zen/game/players/$PLAYER/ipfs/moa/.chain.$MOATS
|
cp ~/.zen/game/players/$PLAYER/ipfs/moa/.chain ~/.zen/game/players/$PLAYER/ipfs/moa/.chain.$MOATS
|
||||||
|
|
||||||
|
@ -661,4 +667,6 @@ echo "${VOEUXLIST}"
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
espeak "Well done my friend. You are feeding the blob. Happy TW"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -24,7 +24,7 @@ MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
|
||||||
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
|
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
|
||||||
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
|
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
|
||||||
|
|
||||||
mkdir -p ~/.zen/tmp/${IPFSNODEID}/vlog/${ASTRONAUTENS}
|
mkdir -p ~/.zen/game/players/${PLAYER}/vlog
|
||||||
|
|
||||||
screencapture(){
|
screencapture(){
|
||||||
vlc \
|
vlc \
|
||||||
|
@ -84,29 +84,30 @@ echo "FOUND : ~/.zen/tmp/output.mp4"
|
||||||
espeak "FILE SIZE = $FILE_SIZE"
|
espeak "FILE SIZE = $FILE_SIZE"
|
||||||
espeak "OK"
|
espeak "OK"
|
||||||
|
|
||||||
mkdir -p ~/.zen/game/players/.${PLAYER}/vlog
|
mkdir -p ~/.zen/game/players/${PLAYER}/vlog
|
||||||
|
|
||||||
## Creating new video chain index.html
|
## Creating new video chain index.html
|
||||||
OLDID=$(cat ~/.zen/game/players/.${PLAYER}/.vlog.index 2>/dev/null)
|
OLDID=$(cat ~/.zen/game/players/${PLAYER}/.vlog.index 2>/dev/null)
|
||||||
if [[ $OLDID ]]; then
|
if [[ $OLDID ]]; then
|
||||||
sed s/_OLDID_/$OLDID/g ${MY_PATH}/../templates/video_chain.html > ~/.zen/tmp/${IPFSNODEID}/vlog/${ASTRONAUTENS}/${MOATS}.index.html
|
sed s/_OLDID_/$OLDID/g ${MY_PATH}/../templates/video_chain.html > ~/.zen/game/players/${PLAYER}/vlog/${MOATS}.index.html
|
||||||
sed -i s/_IPFSID_/$IPFSID/g ~/.zen/tmp/${IPFSNODEID}/vlog/${ASTRONAUTENS}/${MOATS}.index.html
|
sed -i s/_IPFSID_/$IPFSID/g ~/.zen/game/players/${PLAYER}/vlog/${MOATS}.index.html
|
||||||
else
|
else
|
||||||
sed s/_IPFSID_/$IPFSID/g ${MY_PATH}/../templates/video_first.html > ~/.zen/tmp/${IPFSNODEID}/vlog/${ASTRONAUTENS}/${MOATS}.index.html
|
sed s/_IPFSID_/$IPFSID/g ${MY_PATH}/../templates/video_first.html > ~/.zen/game/players/${PLAYER}/vlog/${MOATS}.index.html
|
||||||
fi
|
fi
|
||||||
sed -i s/_DATE_/$(date -u "+%Y-%m-%d#%H:%M:%S")/g ~/.zen/tmp/${IPFSNODEID}/vlog/${ASTRONAUTENS}/${MOATS}.index.html
|
sed -i s/_DATE_/$(date -u "+%Y-%m-%d#%H:%M:%S")/g ~/.zen/game/players/${PLAYER}/vlog/${MOATS}.index.html
|
||||||
sed "s~_PSEUDO_~$PLAYER~g" ~/.zen/tmp/${IPFSNODEID}/vlog/${ASTRONAUTENS}/${MOATS}.index.html > ~/.zen/game/players/.${PLAYER}/vlog/index.html
|
## TODO : THIS IS NOT CHANGING _PSEUDO_ WHY?
|
||||||
|
sed "s~_PSEUDO_~$PLAYER~g" ~/.zen/game/players/${PLAYER}/vlog/${MOATS}.index.html > ~/.zen/game/players/${PLAYER}/vlog/index.html
|
||||||
|
|
||||||
# Copy style & js
|
# Copy style & js
|
||||||
cp -R ${MY_PATH}/../templates/styles ~/.zen/game/players/.${PLAYER}/vlog/
|
cp -R ${MY_PATH}/../templates/styles ~/.zen/game/players/${PLAYER}/vlog/
|
||||||
cp -R ${MY_PATH}/../templates/js ~/.zen/game/players/.${PLAYER}/vlog/
|
cp -R ${MY_PATH}/../templates/js ~/.zen/game/players/${PLAYER}/vlog/
|
||||||
|
|
||||||
IPFSROOT=$(ipfs add -rHq ~/.zen/game/players/.${PLAYER}/vlog | tail -n 1)
|
IPFSROOT=$(ipfs add -rHq ~/.zen/game/players/${PLAYER}/vlog | tail -n 1)
|
||||||
echo $IPFSROOT > ~/.zen/game/players/.${PLAYER}/.vlog.index
|
echo $IPFSROOT > ~/.zen/game/players/${PLAYER}/.vlog.index
|
||||||
# TEMPLATE EVOLUTION
|
# TEMPLATE EVOLUTION
|
||||||
sed 's/_PSEUDO_/$PSEUDO/g' ~/.zen/tmp/${IPFSNODEID}/vlog/${ASTRONAUTENS}/${MOATS}.index.html > ~/.zen/game/players/.${PLAYER}/vlog/index.html
|
sed 's/_PSEUDO_/$PSEUDO/g' ~/.zen/game/players/${PLAYER}/vlog/${MOATS}.index.html > ~/.zen/game/players/${PLAYER}/vlog/index.html
|
||||||
sed 's/_IPFSROOT_/$IPFSROOT/g' ~/.zen/tmp/${IPFSNODEID}/vlog/${ASTRONAUTENS}/${MOATS}.index.html > ~/.zen/game/players/.${PLAYER}/vlog/index.html
|
sed 's/_IPFSROOT_/$IPFSROOT/g' ~/.zen/game/players/${PLAYER}/vlog/${MOATS}.index.html > ~/.zen/game/players/${PLAYER}/vlog/index.html
|
||||||
IPFSROOT=$(ipfs add -rHq ~/.zen/game/players/.${PLAYER}/vlog | tail -n 1)
|
IPFSROOT=$(ipfs add -rHq ~/.zen/game/players/${PLAYER}/vlog | tail -n 1)
|
||||||
|
|
||||||
echo "NEW VIDEO http://127.0.0.1:8080/ipfs/$IPFSROOT"
|
echo "NEW VIDEO http://127.0.0.1:8080/ipfs/$IPFSROOT"
|
||||||
## OUVERTURE VLOG CHAIN
|
## OUVERTURE VLOG CHAIN
|
||||||
|
@ -123,8 +124,8 @@ ANIMH=$(ipfs add -q ~/.zen/tmp/screen.gif)
|
||||||
REAL=$(file --mime-type "$HOME/astroport/video/vlog/$PLAYER_$MEDIAID.mp4" | cut -d ':' -f 2 | cut -d ' ' -f 2)
|
REAL=$(file --mime-type "$HOME/astroport/video/vlog/$PLAYER_$MEDIAID.mp4" | cut -d ':' -f 2 | cut -d ' ' -f 2)
|
||||||
|
|
||||||
## TW not displaying direct ipfs video link (only image, pdf, ...) so insert <video> html tag
|
## TW not displaying direct ipfs video link (only image, pdf, ...) so insert <video> html tag
|
||||||
TEXT="<video controls width=360 preload='none' poster='/ipfs/"${ANIMH}"'><source src='/ipfs/"${IPFSID}"/output.mp4' type='"${REAL}"'></video><h1><a href='/ipfs/"${IPFSROOT}"'>"${PSEUDO}" / VLOG / </a></h1><br>"
|
TEXT="<video controls width=360 preload='none' poster='/ipfs/"${ANIMH}"'><source src='/ipfs/"${IPFSID}"/output.mp4' type='"${REAL}"'></video><h1><a href='/ipfs/"${IPFSROOT}"'>"${PSEUDO}" / VLOG / </a></h1><br>
|
||||||
EXTRA="<\$button class='tc-tiddlylink'><\$list filter='[tag[G1Vlog]]'><\$action-navigate \$to=<<currentTiddler>> \$scroll=no/></\$list>Afficher tous les G1Vlog</\$button>"
|
<\$button class='tc-tiddlylink'><\$list filter='[tag[G1Vlog]]'><\$action-navigate \$to=<<currentTiddler>> \$scroll=no/></\$list>Afficher tous les G1Vlog</\$button>"
|
||||||
|
|
||||||
echo "## Creation json tiddler"
|
echo "## Creation json tiddler"
|
||||||
echo '[
|
echo '[
|
||||||
|
@ -134,18 +135,18 @@ echo '[
|
||||||
"type": "'text/vnd.tiddlywiki'",
|
"type": "'text/vnd.tiddlywiki'",
|
||||||
"mediakey": "'${MEDIAKEY}'",
|
"mediakey": "'${MEDIAKEY}'",
|
||||||
"mime": "'${REAL}'",
|
"mime": "'${REAL}'",
|
||||||
"story": "'/ipfs/${$IPFSROOT}'",
|
"story": "'/ipfs/${IPFSROOT}'",
|
||||||
"size": "'${FILE_BSIZE}'",
|
"size": "'${FILE_BSIZE}'",
|
||||||
"ipfs": "'/ipfs/${IPFSID}'",
|
"ipfs": "'/ipfs/${IPFSID}/output.mp4'",
|
||||||
"gif_ipfs": "'/ipfs/${ANIMH}'",
|
"gif_ipfs": "'/ipfs/${ANIMH}'",
|
||||||
"player": "'${PLAYER}'",
|
"player": "'${PLAYER}'",
|
||||||
"tags": "'${PLAYER} G1Vlog vlog ipfs'"
|
"tags": "'${PLAYER} G1Vlog vlog ipfs'"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
' > ~/.zen/game/players/.${PLAYER}/vlog/${MEDIAKEY}.dragdrop.json
|
' > ~/.zen/game/players/${PLAYER}/vlog/${MEDIAKEY}.dragdrop.json
|
||||||
|
|
||||||
# LOG
|
# LOG
|
||||||
cat ~/.zen/game/players/.${PLAYER}/vlog/${MEDIAKEY}.dragdrop.json | jq
|
cat ~/.zen/game/players/${PLAYER}/vlog/${MEDIAKEY}.dragdrop.json | jq
|
||||||
|
|
||||||
## Adding tiddler to PLAYER TW
|
## Adding tiddler to PLAYER TW
|
||||||
ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
|
ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
|
||||||
|
@ -154,7 +155,7 @@ rm -f ~/.zen/tmp/newindex.html
|
||||||
|
|
||||||
echo "Nouveau TID dans TW $PSEUDO : http://$myIP:8080/ipns/$ASTRONAUTENS"
|
echo "Nouveau TID dans TW $PSEUDO : http://$myIP:8080/ipns/$ASTRONAUTENS"
|
||||||
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html \
|
tiddlywiki --load ~/.zen/game/players/$PLAYER/ipfs/moa/index.html \
|
||||||
--import ~/.zen/game/players/.${PLAYER}/vlog/${MEDIAKEY}.dragdrop.json "application/json" \
|
--import ~/.zen/game/players/${PLAYER}/vlog/${MEDIAKEY}.dragdrop.json "application/json" \
|
||||||
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
|
--output ~/.zen/tmp --render "$:/core/save/all" "newindex.html" "text/plain"
|
||||||
|
|
||||||
if [[ -s ~/.zen/tmp/newindex.html ]]; then
|
if [[ -s ~/.zen/tmp/newindex.html ]]; then
|
||||||
|
@ -184,7 +185,7 @@ else
|
||||||
echo "Une erreur est survenue lors de l'ajout du tiddler VLOG à votre TW"
|
echo "Une erreur est survenue lors de l'ajout du tiddler VLOG à votre TW"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$PSEUDO TW : http://$myIP:8080/ipns/$ASTRONAUTENS"
|
echo "$PSEUDO TW VLOG : http://$myIP:8080/ipns/$ASTRONAUTENS/#:[tag[vlog]]"
|
||||||
|
|
||||||
# ~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/video/${MEDIAID}/" "output.mp4" "$G1PUB"
|
# ~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/video/${MEDIAID}/" "output.mp4" "$G1PUB"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue