forked from axiom-team/astroport
30 lines
1.2 KiB
Bash
30 lines
1.2 KiB
Bash
|
#!/bin/bash
|
||
|
########################################################################
|
||
|
# Author: Fred (support@qo-op.com)
|
||
|
# Version: 2020.12.05
|
||
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
||
|
########################################################################
|
||
|
# Transfert ~/astroport/files to IPFS and create Astroport(pastebin) index for Xbian/Vstream
|
||
|
########################################################################
|
||
|
[[ -f ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid ]] && echo "ERROR no _xbian.zuid" && exit 1
|
||
|
|
||
|
# GET xbian-ZUID
|
||
|
XZUID=$(cat ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid)
|
||
|
|
||
|
# CREATE Vstream/Pastebin file format
|
||
|
# https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films
|
||
|
|
||
|
ASHARE=$(ipfs add -rq ~/astroport/ | tail -n 1)
|
||
|
|
||
|
[[ $ASHARE == "" ]] && echo "ERROR adding ~/astroport to IPFS" && exit 1
|
||
|
|
||
|
echo "TITLE;URLS" > ~/.zen/ipfs/xbian/$XZUID
|
||
|
for file in ~/astroport/*
|
||
|
do
|
||
|
filename=$(basename -- "$file")
|
||
|
extension="${filename##*.}"
|
||
|
filena="${filename%.*}"
|
||
|
echo "$filena;http://localhost:8080/ipfs/$ASHARE/$filename"
|
||
|
echo "$filena;http://localhost:8080/ipfs/$ASHARE/$filename" >> ~/.zen/ipfs/xbian/$XZUID
|
||
|
done
|