forked from axiom-team/astrXbian
Add external call from 1234 port Welcome g1-compagnon API
This commit is contained in:
parent
a9d76db1a4
commit
3825b1bebc
|
@ -543,27 +543,25 @@ timestamp=$(date -u +%s%N | cut -b1-13)
|
||||||
|
|
||||||
## AUTO DESTRUCTIVE ADD TO ASTROPORT IPFS SCRIPT
|
## AUTO DESTRUCTIVE ADD TO ASTROPORT IPFS SCRIPT
|
||||||
echo "MEDIAKEY=${MEDIAKEY}" > ~/astroport/Add_${MEDIAKEY}_script.sh
|
echo "MEDIAKEY=${MEDIAKEY}" > ~/astroport/Add_${MEDIAKEY}_script.sh
|
||||||
[[ $CHOICE == "TMDB" ]] && echo "echo \"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER.. Sinon saisissez qqch avant...\"
|
#[[ $CHOICE == "TMDB" ]] && echo "echo \"Encoder ${FILE_NAME} en h265 avant import ? Tapez sur ENTER.. Sinon saisissez qqch avant...\"
|
||||||
reponse=\$1
|
#reponse=\$1
|
||||||
[[ ! \$reponse ]] && read reponse
|
#[[ ! \$reponse ]] && read reponse
|
||||||
if [[ ! \$reponse ]]; then
|
#if [[ ! \$reponse ]]; then
|
||||||
ffmpeg -i \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}\" -vcodec libx265 -crf 28 $HOME/astroport/${MEDIAID}.mp4
|
# ffmpeg -i \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}\" -vcodec libx265 -crf 28 $HOME/astroport/${MEDIAID}.mp4
|
||||||
mv \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}\" \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}.old\"
|
# mv \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}\" \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}.old\"
|
||||||
mv $HOME/astroport/${MEDIAID}.mp4 \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}.mp4\"
|
# mv $HOME/astroport/${MEDIAID}.mp4 \"$HOME/astroport/${CAT}/${MEDIAID}/${FILE_NAME}.mp4\"
|
||||||
~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}.mp4\"
|
# ~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}.mp4\"
|
||||||
else" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
#else" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
||||||
|
|
||||||
echo "~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" " >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
echo "~/.zen/astrXbian/zen/new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\" " >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
||||||
|
|
||||||
[[ $CHOICE == "TMDB" ]] && echo "fi" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
#[[ $CHOICE == "TMDB" ]] && echo "fi" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
||||||
|
|
||||||
echo "rm -f /tmp/\${MEDIAKEY}.pass
|
echo "rm -f /tmp/\${MEDIAKEY}.pass
|
||||||
rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS
|
rm -f /tmp/\${MEDIAKEY}.dunikey ## REMOVE KEYS
|
||||||
mv ~/astroport/Add_${MEDIAKEY}_script.sh ~/astroport/Done_${FILE_NAME}.sh
|
mv ~/astroport/Add_${MEDIAKEY}_script.sh ~/astroport/Done_${FILE_NAME}.sh
|
||||||
" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
" >> ~/astroport/Add_${MEDIAKEY}_script.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
chmod +x ~/astroport/Add_${MEDIAKEY}_script.sh
|
chmod +x ~/astroport/Add_${MEDIAKEY}_script.sh
|
||||||
|
|
||||||
## DELAYED IPFS ADD TO ASTROPORT ... COULD BE MANAGED BY CRON
|
## DELAYED IPFS ADD TO ASTROPORT ... COULD BE MANAGED BY CRON
|
||||||
|
@ -600,14 +598,16 @@ FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1;
|
||||||
#fi
|
#fi
|
||||||
########################################################################
|
########################################################################
|
||||||
########################################################################
|
########################################################################
|
||||||
|
if [ $1 ]; then
|
||||||
|
bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265"
|
||||||
|
[ $? == 0 ] && echo "${MEDIAKEY} is RECORDED in ASTROPORT. GOOD." && exit 0
|
||||||
|
|
||||||
|
else
|
||||||
zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \
|
zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \
|
||||||
[ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265" \
|
[ $? == 0 ] && bash ~/astroport/Add_${MEDIAKEY}_script.sh "noh265" \
|
||||||
&& zenity --warning --width 300 --text "Ajoutez ce media dans vos journaux public 'qo-op' ou administratif 'moa'" \
|
&& zenity --warning --width 300 --text "Ajoutez ce media dans vos journaux public 'qo-op' ou administratif 'moa'" \
|
||||||
&& [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] \
|
&& [[ $(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) ]] \
|
||||||
&& xdg-open "http://127.0.0.1:8080/ipns/$(cat ~/.zen/game/players/.current/.playerns)" \
|
&& xdg-open "http://127.0.0.1:8080/ipns/$(cat ~/.zen/game/players/.current/.playerns)" \
|
||||||
|| ( zenity --warning --width 300 --text "Désolé une erreur est survenue... /tmp/${MEDIAKEY}.log" && exit 1 )\
|
|| ( zenity --warning --width 300 --text "Désolé une erreur est survenue... cat /tmp/${MEDIAKEY}.log" && exit 1 )\
|
||||||
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
echo "${MEDIAKEY} = RECORDED TO IPFS."
|
|
||||||
cat /tmp/${MEDIAKEY}.log
|
|
||||||
|
|
|
@ -453,6 +453,11 @@ then
|
||||||
]
|
]
|
||||||
' >> ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json
|
' >> ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json
|
||||||
|
|
||||||
|
|
||||||
|
## SEND TW json to GCHANGE (call from g1-compagnon
|
||||||
|
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" send -d $3 -t "MEDIAKEY ${MEDIAKEY}" -m "$(cat ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json)"
|
||||||
|
|
||||||
|
|
||||||
# Will be used by caroussel.html template
|
# Will be used by caroussel.html template
|
||||||
# CAROUSSEL=$(ipfs add -wq ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json | head-n 1)
|
# CAROUSSEL=$(ipfs add -wq ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json | head-n 1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue