From 49760cb10d1a48a6de7bf496524c66d68eee1c12 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 3 Jul 2022 21:41:04 +0200 Subject: [PATCH] scan Mediakey for displaying Dreamcatcher Capsule --- templates/dreamcatcher.html | 3421 +++++++++++++++++++++++++++++++++++ tools/qrscan_login.sh | 27 +- tools/vlc_webcam.sh | 27 +- 3 files changed, 3456 insertions(+), 19 deletions(-) create mode 100644 templates/dreamcatcher.html diff --git a/templates/dreamcatcher.html b/templates/dreamcatcher.html new file mode 100644 index 00000000..451c2e67 --- /dev/null +++ b/templates/dreamcatcher.html @@ -0,0 +1,3421 @@ + + + + + + + + + + + + + + + + + + + + +_TITLE_ est dans Astroport — Espace Public + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/tools/qrscan_login.sh b/tools/qrscan_login.sh index ce90cef6..2a635b4f 100755 --- a/tools/qrscan_login.sh +++ b/tools/qrscan_login.sh @@ -7,17 +7,8 @@ ME="${0##*/}" MOATS=$(date -u +"%Y%m%d%H%M%S%4N") IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) -instascan=$(ps auxf --sort=+utime | grep -w nc | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) -[[ $instascan ]] && echo "already running" && exit 1 - -# Check who is .current PLAYER -PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 ) -PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 ) -G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 ) -IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 ) -PLAYERNS=$(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) || ( echo "noplayerns" && exit 1 ) -MOANS=$(cat ~/.zen/game/players/.current/.moans 2>/dev/null) || ( echo "noplayermoans" && exit 1 ) -QOOPNS=$(cat ~/.zen/game/players/.current/.qoopns 2>/dev/null) || ( echo "noplayerqoopns" && exit 1 ) +qrscan=$(ps auxf --sort=+utime | grep -w qrscan_login.sh | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) +[[ $qrscan ]] && echo "qrscan already running" && exit 1 # Check if Astroport Station already has a "captain" source ~/.zen/ipfs.sync; echo "Le capitaine de cet Astroport est actuellement $CAPTAIN" @@ -33,12 +24,26 @@ cat /dev/ttyACM0 | while read line; do ## FORCE LOCAL USE ONLY. Remove to open 1234 API [[ ! -d ~/.zen/game/players/$PLAYER || $PLAYER == "" ]] && echo "AUCUN PLAYER !!" && exit 1 + espeak "Astronaute $PSEUDO. Welcome!" ## LOGIN rm -f ~/.zen/game/players/.current ln -s ~/.zen/game/players/$PLAYER ~/.zen/game/players/.current + # Check who is .current PLAYER + PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 ) + PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 ) + G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 ) + IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 ) + PLAYERNS=$(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) || ( echo "noplayerns" && exit 1 ) + MOANS=$(cat ~/.zen/game/players/.current/.moans 2>/dev/null) || ( echo "noplayermoans" && exit 1 ) + QOOPNS=$(cat ~/.zen/game/players/.current/.qoopns 2>/dev/null) || ( echo "noplayerqoopns" && exit 1 ) + + espeak "Opening your TW5" ~/.zen/Astroport.ONE/tools/PLAYER.entrance.sh ## Switch IPFS Layer with Astronaut ID & astrXbian data index structure + espeak "Report your best dreams and plans to the astroport captain. Love." + + break done diff --git a/tools/vlc_webcam.sh b/tools/vlc_webcam.sh index 28197680..c70efd9c 100755 --- a/tools/vlc_webcam.sh +++ b/tools/vlc_webcam.sh @@ -30,6 +30,8 @@ mkdir -p ~/.zen/tmp/ #[[ $desktop != "" ]] && screencapture PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( espeak "no player. EXIT" && exit 1 ) PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( espeak "no pseudo. EXIT" && exit 1 ) +G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( espeak "no g1 pub" && exit 1 ) +IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( espeak "no ipfs node id" && exit 1 ) espeak "$PSEUDO" sleep 1 @@ -61,7 +63,7 @@ echo "NEW VIDEO FILE /ipfs/$IPFSID/output.mp4" espeak "OK" -mkdir -p ~/.zen/game/players/.current/publish +mkdir -p ~/.zen/game/players/.current/vlog ## Creating new video chain index.html OLDID=$(cat ~/.zen/game/players/.current/.vlog.index 2>/dev/null) @@ -72,23 +74,32 @@ else sed s/_IPFSID_/$IPFSID/g ${MY_PATH}/../templates/video_first.html > /tmp/index.html fi sed -i s/_DATE_/$(date -u "+%Y-%m-%d#%H:%M:%S")/g /tmp/index.html -sed s/_PSEUDO_/$PLAYER/g /tmp/index.html > ~/.zen/game/players/.current/publish/index.html +sed s/_PSEUDO_/$PLAYER/g /tmp/index.html > ~/.zen/game/players/.current/vlog/index.html # Copy style & js -cp -R ${MY_PATH}/../templates/styles ~/.zen/game/players/.current/publish/ -cp -R ${MY_PATH}/../templates/js ~/.zen/game/players/.current/publish/ +cp -R ${MY_PATH}/../templates/styles ~/.zen/game/players/.current/vlog/ +cp -R ${MY_PATH}/../templates/js ~/.zen/game/players/.current/vlog/ -IPFSROOT=$(ipfs add -rHq ~/.zen/game/players/.current/publish | tail -n 1) +IPFSROOT=$(ipfs add -rHq ~/.zen/game/players/.current/vlog | tail -n 1) echo $IPFSROOT > ~/.zen/game/players/.current/.vlog.index # Change CSS path to -sed s/_IPFSROOT_/$IPFSROOT/g /tmp/index.html > ~/.zen/game/players/.current/publish/index.html -IPFSROOT=$(ipfs add -rHq ~/.zen/game/players/.current/publish | tail -n 1) +sed s/_IPFSROOT_/$IPFSROOT/g /tmp/index.html > ~/.zen/game/players/.current/vlog/index.html +IPFSROOT=$(ipfs add -rHq ~/.zen/game/players/.current/vlog | tail -n 1) echo "NEW VIDEO http://127.0.0.1:8080/ipfs/$IPFSROOT" - +## OUVERTURE VLOG CHAIN xdg-open "http://127.0.0.1:8080/ipfs/$IPFSROOT" +## AJOUT VIDEO ASTROPORT + +MEDIAID="$(date -u +%s%N | cut -b1-13)" +mkdir -p ~/astroport/video/${MEDIAID}/ +MEDIAKEY="VIDEO_${MEDIAID}" +cp ~/.zen/tmp/output.mp4 ~/astroport/video/${MEDIAID}/ + +~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/video/${MEDIAID}/" "output.mp4" "$G1PUB" + # https://stackoverflow.com/questions/49846400/raspberry-pi-use-vlc-to-stream-webcam-logitech-c920-h264-video-without-tran # record to MKV cvlc v4l2:///dev/video0:chroma=h264 :input-slave=alsa://hw:1,0 --sout '#transcode{acodec=mpga,ab=128,channels=2,samplerate=44100,threads=4,audio-sync=1}:standard{access=file,mux=mkv,dst='~/.zen/tmp/Webcam_Record/MyVid.mkv'}' # record to MP4 cvlc v4l2:///dev/video0:chroma=h264 :input-slave=alsa://hw:1,0 --sout '#transcode{acodec=mpga,ab=128,channels=2,samplerate=44100,threads=4,audio-sync=1}:standard{access=file,mux=mp4,dst='~/.zen/tmp/Webcam_Record/MyVid.mp4'}'