mp4 caroussel from 'Journal'

This commit is contained in:
fred 2022-04-24 13:59:16 +02:00
parent 2c9966099d
commit 9dca3e91ba
3 changed files with 51 additions and 22 deletions

View File

@ -213,6 +213,7 @@ echo "##########################################################################
cat ~/.zen/bunkerbox/history.${CHANNEL}.json | jq '.Videos += [{"link": "<a id='"'_TS_'"' href='"'_INDEX_'"'><img src='"'_INDEX_/_VUID_.jpg'"' height=80 ></a><br>'"'_TITLE_'"'"}]' > ~/.zen/bunkerbox/cache/$VUID/media/history.${CHANNEL}.json
sed -i "s~_INDEX_~$INDEX~g" ~/.zen/bunkerbox/cache/$VUID/media/history.${CHANNEL}.json
sed -i "s~_VUID_~$VUID~g" ~/.zen/bunkerbox/cache/$VUID/media/history.${CHANNEL}.json
sed -i "s~_TS_~$MOATS~g" ~/.zen/bunkerbox/cache/$VUID/media/history.${CHANNEL}.json
sed -i "s~_TITLE_~$TITLE~g" ~/.zen/bunkerbox/cache/$VUID/media/history.${CHANNEL}.json
# SECURE
[[ "$(cat ~/.zen/bunkerbox/cache/$VUID/media/history.${CHANNEL}.json)" == "" ]] && echo "NO history.${CHANNEL}.json FATAL ERROR" && exit 1
@ -223,35 +224,42 @@ echo "##########################################################################
######################### ######################### #########################
## CONSTRUCT 'MOA' CHANNEL PUBLICATION ZONE ```rm -Rf ~/.zen/bunkerbox/channels/${CHANNEL} to reset```
AmIBootStrap=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt 2>/dev/null | grep $IPFSNODEID)
if [[ ! -f ~/.zen/bunkerbox/homepage/tw/${CHANNEL}/index.html && $AmIBootStrap ]]; then
if [[ ! -f ~/.zen/bunkerbox/homepage/tw/${CHANNEL}/twindex.html ]]; then
mkdir -p ~/.zen/bunkerbox/homepage/tw/${CHANNEL}/
mkdir -p ~/.zen/bunkerbox/channels/${CHANNEL}/
# New tiddlywiki with moa key
# if [[ ! $(ipfs key list | grep -w qo-op_${CHANNEL}) ]]; then
channelfilename=$(${MY_PATH}/tools/give_me_keystore_filename.py qo-op_${CHANNEL})
# (Re)Creating IPNS Key & TiddlyWiki for channel
ipfs key rm qo-op_${CHANNEL}
channelkey=$(ipfs key gen qo-op_${CHANNEL})
# Create first tiddlywiki and inject some values
sed "s~_BIRTHDATE_~${MOATS}~g" ${MY_PATH}/templates/ipfstiddlywiki.html > ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
sed -i "s~_PSEUDO_~${CHANNEL}~g" ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
sed -i "s~_MOAID_~${channelkey}~g" ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
sed -i "s~_QOOP_~${IPNSL}~g" ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
sed -i "s~_MOAKEY_~qo-op_${CHANNEL}~g" ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
sed -i "s~k2k4r8opmmyeuee0xufn6txkxlf3qva4le2jlbw6da7zynhw46egxwp2~${channelkey}~g" ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
sed -i "s~ipfs.infura.io~tube.copylaradio.com~g" ~/.zen/bunkerbox/channels/${CHANNEL}/index.html ## Open 5001
sed -i "s~_IPFSNODEID_~${IPFSNODEID}~g" ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
[[ $AmIBootStrap ]] &&\
ipfs key rm qo-op_${CHANNEL}; channelkey=$(ipfs key gen qo-op_${CHANNEL}) || \
channelkey='k2k4r8opmmyeuee0xufn6txkxlf3qva4le2jlbw6da7zynhw46egxwp2'
# Create first tiddlywiki and inject some values (_PLAYER_ from Astroport.ONE)
sed "s~_BIRTHDATE_~${MOATS}~g" ${MY_PATH}/templates/ipfstiddlywiki.html > ~/.zen/bunkerbox/channels/${CHANNEL}/twindex.html
sed -i "s~_PSEUDO_~${CHANNEL}~g" ~/.zen/bunkerbox/channels/${CHANNEL}/twindex.html
sed -i "s~_MOAID_~${channelkey}~g" ~/.zen/bunkerbox/channels/${CHANNEL}/twindex.html
sed -i "s~_QOOP_~${IPNSL}~g" ~/.zen/bunkerbox/channels/${CHANNEL}/twindex.html
sed -i "s~_MOAKEY_~qo-op_${CHANNEL}~g" ~/.zen/bunkerbox/channels/${CHANNEL}/twindex.html
sed -i "s~k2k4r8opmmyeuee0xufn6txkxlf3qva4le2jlbw6da7zynhw46egxwp2~${channelkey}~g" ~/.zen/bunkerbox/channels/${CHANNEL}/twindex.html
sed -i "s~ipfs.infura.io~tube.copylaradio.com~g" ~/.zen/bunkerbox/channels/${CHANNEL}/twindex.html ## Open 5001
sed -i "s~_IPFSNODEID_~${IPFSNODEID}~g" ~/.zen/bunkerbox/channels/${CHANNEL}/twindex.html
# Create caroussel.html !!! NOT WORKING WITH M3U8 !!!! SO DOING IT WITH astrXbian ;)
sed "s~_IPNSL_~$IPNSL~g" ${MY_PATH}/templates/caroussel.html > ~/.zen/bunkerbox/channels/${CHANNEL}/caroussel.html
sed -i "s~_VUID_~$INDEX/$VUID~g" ~/.zen/bunkerbox/channels/${CHANNEL}/caroussel.html
sed -i "s~_TITLE_~$TITLE~g" ~/.zen/bunkerbox/channels/${CHANNEL}/caroussel.html
sed -i "s~_CHANNEL_~$CHANNEL~g" ~/.zen/bunkerbox/channels/${CHANNEL}/caroussel.html
XBIANJSON=$(${MY_PATH}/tools/get_astrXbian_youtube.sh) ## Replace old way with external caroussel.json
sed -i "s~_CAROUSSELJSON_~$XBIANJSON~g" ~/.zen/bunkerbox/channels/${CHANNEL}/caroussel.html
cp -R ${MY_PATH}/templates/styles ~/.zen/bunkerbox/channels/${CHANNEL}/
cp -R ${MY_PATH}/templates/js ~/.zen/bunkerbox/channels/${CHANNEL}/
if [[ $XBIANJSON == '' ]]; then
echo "<meta http-equiv=\"refresh\" content=\"0;URL=twindex.html\">" > ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
else
sed "s~_IPNSL_~$IPNSL~g" ${MY_PATH}/templates/caroussel.html > ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
sed -i "s~_VUID_~$INDEX/$VUID~g" ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
sed -i "s~_TITLE_~$TITLE~g" ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
sed -i "s~_CHANNEL_~$CHANNEL~g" ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
sed -i "s~_CAROUSSELJSON_~$XBIANJSON~g" ~/.zen/bunkerbox/channels/${CHANNEL}/index.html
cp -R ${MY_PATH}/templates/styles ~/.zen/bunkerbox/channels/${CHANNEL}/
cp -R ${MY_PATH}/templates/js ~/.zen/bunkerbox/channels/${CHANNEL}/
fi
## BACKUP IPNS KEY qo-op_${CHANNEL}.key WILL BE SENT BY OTHER MEAN
# cp ~/.ipfs/keystore/${channelfilename} ~/.zen/bunkerbox/channels/${CHANNEL}/qo-op_${CHANNEL}.key

View File

@ -38,7 +38,7 @@
width="auto" height="360"
poster="_VUID_.jpg"
>
<source src="_VUID_.m3u8" type="application/x-mpegURL" />
<source src="_VUID_.mp4" type="video/mp4" />
<p class="vjs-no-js">
Activer JavaScript SVP
</p>

View File

@ -1,6 +1,29 @@
#!/bin/bash
# echo create data set from astrXbian youtube copies to include into caroussel
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
[[ -d ~/Bureau ]] && DESK="Bureau"
[[ -d ~/Desktop ]] && DESK="Desktop"
DATA=""
for tiddler in $(ls ~/$DESK/Journal/youtube/*.json); do
title=$(cat $tiddler | jq -r .[0].title)
text=$(cat $tiddler | jq -r .[0].text)
mime=$(cat $tiddler | jq -r .[0].mime)
poster=$(cat $tiddler | jq -r .[0].poster)
ipfsroot=$(cat $tiddler | jq -r .[0].ipfsroot)
file=$(cat $tiddler | jq -r .[0].file)
[[ $poster == '' ]] && poster='/ipns/crowdbunker.com/styles/logo.png'
source='/ipfs/'$ipfsroot/$file
DATA="$DATA { src : '"${source}"', poster: '"${poster}"', mime : '"${mime}"', title : '"${title}"' },"
done
[[ $DATA != '' ]] && echo 'videos : [ '$DATA' ]'
exit 0
[[ ! $IPFSNODEID ]] && echo "Please Install IPFS & astrXbian for this to work" && exit 1
@ -12,5 +35,3 @@ for line in $(cat ~/.zen/ipfs/.$IPFSNODEID/YASTRXBIAN); do
DATA="$DATA { src : '"${source}"', poster: '"/ipns/crowdbunker.com/styles/logo.png"', mime : 'video/mp4', title : '"${title}"' },"
done
echo 'videos : [ '$DATA' ]'