BunkerBOX copie, conserve et partage les chaines vidéos dans IPFS
This commit is contained in:
parent
3b60ef5c2a
commit
c27df6262d
36
README.md
36
README.md
|
@ -1,30 +1,37 @@
|
|||
# bunkerbox
|
||||
|
||||
Sauvegarde et Hébergement collectif de Chaine video dans IPFS / IPNS.
|
||||
|
||||
**BunkerBOX copie, conserve et partage les chaines vidéos dans IPFS.
|
||||
Rendez in-censurable, in-arrêtable la liberté d'expression.**
|
||||
|
||||
Sauvegarde et Hébergement collectif de Chaine Video dans IPFS / IPNS.
|
||||
- Source : https://crowdbunker.com
|
||||
|
||||
IPFS est particulièrement efficace en ce qui concerne la conservation et la diffusion de données sur Internet.
|
||||
Chaque media est inscrit dans un template html qui permet de le consulter et d'accéder à l'historique.
|
||||
Chaque media est accompagné d'un template html pour permetre de le consulter et d'accéder à l'historique.
|
||||
|
||||
En suivant le même principe, vous pouvez facilement créer des chaines de vidéos depuis d'autres sources (webcam, etc...)
|
||||
En suivant ce principe, vous créez facilement des chaines de vidéos depuis n'importe quelle autre source (webcam, etc...)
|
||||
En ajoutant de nouveaux "json" et traitements "jQuery", les possibilités sont immenses.
|
||||
|
||||
Pour faire tourner ce code, il vaut mieux une bonne connexion (fibre) et laisser son ordinateur fonctionner 24/24 pour vraiment être efficace pour le réseau...
|
||||
> Avant de faire tourner ce code de façon récurrente,
|
||||
> il est préférable de l'installer sur une machine dédiée avec une bonne connexion (fibre)
|
||||
> et laisser l'ordinateur fonctionner 24/24 pour fournir un service de qualité au réseau...
|
||||
|
||||
Si ce n'est pas le cas, vous pouvez apporter votre aide en installant :
|
||||
- [IPFS Desktop](https://github.com/ipfs/ipfs-desktop/releases) ou IPFS-CLI
|
||||
Sinon, vous pouvez simplement installer IPFS et contribuer de façon partielle avec :
|
||||
- [IPFS Desktop](https://github.com/ipfs/ipfs-desktop/releases) sur votre ordinateur personnel.
|
||||
- et [IPFS-Companion](https://docs.ipfs.io/install/ipfs-companion/#install) dans votre navigateur.
|
||||
|
||||
Dans ce cas, vos visites allégeront la charge que le serveur encaisse en répartissant les flux réseaux de façon plus optimale.
|
||||
Dans ce cas, vos visites sur les sites 'passerelles IPFS' allégeront la charge à supporter en répartissant les flux réseaux de façon plus optimale.
|
||||
|
||||
**Découvrez les principes et propriétes innovantes de IPFS**
|
||||
|
||||
[![](./images/tesseract.gif)](https://www.youtube.com/watch?v=7MGMkGq60VU)
|
||||
|
||||
# Installation
|
||||
|
||||
```
|
||||
## POUR UN HEBERGEMENT 24/24.
|
||||
# INSTALL
|
||||
#######################################################
|
||||
## INSTALL BUNKER BOX
|
||||
#######################################################
|
||||
mkdir ~/workspace && cd ~/workspace
|
||||
git clone https://git.p2p.legal/qo-op/bunkerbox.git
|
||||
|
||||
|
@ -33,12 +40,11 @@ cd ~/workspace/bunkerbox
|
|||
./crowdbunker.sh
|
||||
|
||||
## Une fois les tests et la configuration réalisée.
|
||||
## Choisissez l'option 'qo-op' et publiez vos copies sur
|
||||
## Choisissez l'option 'qo-op' pour publier vos copies dans la liste commune
|
||||
# https://tube.copylaradio.com/ipns/k51qzi5uqu5djt17zonkpg1cb8hrxhahpesybusz8q57j4ocqm0qlc6s99z60x
|
||||
#######################################################
|
||||
## Pensez à ajouter l'execution régulière de ce programme à votre crontab
|
||||
#######################################################
|
||||
```
|
||||
Pour récupérer les dernières vidéos. Ajoutez l'execution régulière de ce programme à votre crontab.
|
||||
|
||||
# Détails
|
||||
|
||||
|
@ -52,7 +58,9 @@ https://ipfs.io/ipns/k51qzi5uqu5djt17zonkpg1cb8hrxhahpesybusz8q57j4ocqm0qlc6s99z
|
|||
1. Récupère la liste des 30 dernières video publiées sur https://crowdbunker.com
|
||||
2. Télécharge les fichiers video et audio (360p de préférence) et leurs fichiers m3u8
|
||||
3. Ajoute le lecteur videojs dans index.html et met à jour history.json
|
||||
4. Publie localement ou sur la clef IPFS qo-op ou au travers du TestNet astrXbian
|
||||
4. Publie localement, sur la clef IPNS 'qo-op' ou au travers du TestNet 'astrXbian'
|
||||
|
||||
|
||||
Pour revenir en mode "debug", effacez le fichier ~/.zen/bunkerbox/choice
|
||||
|
||||
#
|
||||
|
|
|
@ -29,9 +29,11 @@ echo "IPFS GATEWAY $IPFSNGW"
|
|||
## GET LATEST VIDEOS
|
||||
VWALLURL="https://api.crowdbunker.com/post/all"
|
||||
curl -s $VWALLURL -H "Accept: application/json" > ~/.zen/bunkerbox/crowd.json
|
||||
[[ ! -f ~/.zen/bunkerbox/crowd.json ]] && echo "ERROR GET VIDEO SOURCE LIST FROM $VWALLURL" && exit 1
|
||||
|
||||
## LOOP THROUGH (REVERSE LIST)
|
||||
cat ~/.zen/bunkerbox/crowd.json | jq -r '.posts | .[] | .video.id' > /tmp/vuid.list
|
||||
# Reverse list to start with older videos
|
||||
for VUID in $(tac /tmp/vuid.list); do
|
||||
[[ "$VUID" == "null" ]] && echo "MESSAGE... Bypassing..." && echo && continue
|
||||
echo "Bunker BOX : Adding $VUID"
|
||||
|
@ -70,9 +72,12 @@ for VUID in $(tac /tmp/vuid.list); do
|
|||
VSIZE=360 && VIDEOHEAD=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep -B1 ${VSIZE}p | head -n 1) && VIDEOSRC=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep ${VSIZE}p | tail -n 1 | cut -f 1 -d '.')
|
||||
[[ "$VIDEOSRC" == "" ]] && VSIZE=480 && VIDEOHEAD=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep -B1 ${VSIZE}p | head -n 1) && VIDEOSRC=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep ${VSIZE}p | tail -n 1 | cut -f 1 -d '.')
|
||||
[[ "$VIDEOSRC" == "" ]] && VSIZE=240 &&VIDEOHEAD=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep -B1 ${VSIZE}p | head -n 1) && VIDEOSRC=$(cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 | grep ${VSIZE}p | tail -n 1 | cut -f 1 -d '.')
|
||||
VTHUMB="$(cat ~/.zen/bunkerbox/$VUID/$VUID.json | jq -r --arg VSIZE "$VSIZE" '.video.thumbnails[] | select(.height == $VSIZE) | .url')"
|
||||
## NO VIDEO ?
|
||||
[[ "$VIDEOSRC" == "" ]] && echo "NO COMPATIBLE RESOLUTION VIDEO FOUND." && cat ~/.zen/bunkerbox/$VUID/$VUID.m3u8 && continue
|
||||
|
||||
echo ">>>>>>>>>>>>>>>> Downloading Video $VSIZE Thumbnail"
|
||||
# THUMBNAIL
|
||||
VTHUMB="$(cat ~/.zen/bunkerbox/$VUID/$VUID.json | jq -r --arg VSIZE "$VSIZE" '.video.thumbnails[] | select(.height == $VSIZE) | .url')"
|
||||
echo ">>>>>>>>>>>>>>>> Downloading $VSIZE Thumbnail"
|
||||
[[ ! -f ~/.zen/bunkerbox/$VUID/media/$VUID.jpg ]] && curl -s $VTHUMB -o ~/.zen/bunkerbox/$VUID/media/$VUID.jpg
|
||||
[[ ! -f ~/.zen/bunkerbox/$VUID/media/$VUID.jpg ]] && cp ${MY_PATH}/images/astroport.jpg ~/.zen/bunkerbox/$VUID/media/$VUID.jpg # CORRECT MISSING THUMB
|
||||
|
||||
|
@ -114,15 +119,15 @@ echo "##########################################################################
|
|||
cp ${MY_PATH}/templates/videojs.html ~/.zen/bunkerbox/$VUID/media/index.html
|
||||
cp ${MY_PATH}/images/astroport.jpg ~/.zen/bunkerbox/$VUID/media/
|
||||
|
||||
## CREATE FIRST HISTORY from TEMPLATE
|
||||
## NO HISTORY? COPY from TEMPLATE (PROGRAM START)
|
||||
[[ ! -f ~/.zen/bunkerbox/history.json ]] && cp ${MY_PATH}/templates/data/history.json ~/.zen/bunkerbox/history.json
|
||||
|
||||
# qo-op get latest history.json
|
||||
if [[ "$(cat ~/.zen/bunkerbox/choice 2>/dev/null)"=="qo-op" ]]; then
|
||||
IPNSL="/ipns/$(cat ~/.zen/bunkerbox/qo-op)"
|
||||
ipfs get -o ~/.zen/bunkerbox/history.qo-op.json $IPNSL/history.json # Get actual IPNS qo-op history.json
|
||||
[[ $(cat ~/.zen/bunkerbox/history.qo-op.json | jq .Videos[].link | grep $VUID) ]] && echo "Video déjà dans history" && cp ~/.zen/bunkerbox/history.qo-op.json ~/.zen/bunkerbox/history.json && continue
|
||||
# FUSION/REPLACEMENT WHAT TODO ?
|
||||
[[ $(cat ~/.zen/bunkerbox/history.qo-op.json | jq .Videos[].link | grep $VUID) ]] && echo "VIDEO DEJA DANS IPFS... CONTINUE" && echo && cp ~/.zen/bunkerbox/history.qo-op.json ~/.zen/bunkerbox/history.json && continue
|
||||
# JSON FUSION
|
||||
jq -s '.[0] * .[1]' ~/.zen/bunkerbox/history.json ~/.zen/bunkerbox/history.qo-op.json | jq -M '.Videos |= unique_by(.link)' > ~/.zen/bunkerbox/history.fusion.json
|
||||
mv ~/.zen/bunkerbox/history.fusion.json ~/.zen/bunkerbox/history.json ## REPLACE LOCAL HISTORY CACHE
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue