capture votre écran comme vignette /ipfs/$SCREENDIR/screen.png

This commit is contained in:
fred 2022-04-23 21:23:13 +02:00
parent 616adfa6ec
commit 76198f678f
2 changed files with 20 additions and 8 deletions

View File

@ -56,8 +56,8 @@ IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
[[ -f ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title ]] && XGUID="$(cat ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_title)" || XGUID="$(cat /etc/hostname)"
[[ -f ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid ]] && XZUID=$(cat ~/.zen/ipfs/.$IPFSNODEID/_xbian.zuid)
# zenity --warning --width 300 --text "Ajoutez un MEDIA dans ASTROPORT"
zenity --warning --width 300 --text "Cliquez nous capturons votre écran comme vignette MEDIA"
import -window root /tmp/screen.png
########################################################################
## CADRE EXCEPTION COPIE PRIVE
@ -263,7 +263,7 @@ rm -Rf ${YTEMP}
########################################################################
mp3)
zenity --warning --width 600 --text 'DEVELOPPEMENT . ZONE . Please Participate https://git.p2p.legal'
zenity --warning --width 600 --text 'DEV ZONE . Please Participate https://git.p2p.legal'
# Create TEMP directory
YTEMP="$HOME/astroport/tmp/$(date -u +%s%N | cut -b1-13)"
@ -350,12 +350,16 @@ FILE_TITLE="${FILE_NAME%.*}"
zenity --question --width 300 --text "Ouvrir https://www.themoviedb.org pou récupérer le numéro d'identification de $(echo ${FILE_TITLE} | sed 's/_/%20/g') ?"
[ $? == 0 ] && xdg-open "https://www.themoviedb.org/search?query=$(echo ${FILE_TITLE} | sed 's/_/%20/g')"
MEDIAID=$(zenity --entry --title="Identification TMDB" --text="Indiquez le numéro de la fiche du film. Ex: 301528 pour une adresse https://www.themoviedb.org/movie/301528-toy-story-4)" --entry-text="")
MEDIAID=$(zenity --entry --title="Identification TMDB" --text="Copiez le nom de la page du film. Ex: 301528-toy-story-4 pour une adresse https://www.themoviedb.org/movie/301528-toy-story-4)" --entry-text="")
[[ $MEDIAID == "" ]] && exit 1
if ! [[ "$MEDIAID" =~ ^[0-9]+$ ]]
CMED=$(echo $MEDIAID | cut -d '-' -f 1)
TMTL=$(echo $MEDIAID | cut -d '-' -f 2-) # contient la fin du nom de fichier tmdb (peut servir?)
if ! [[ "$CMED" =~ ^[0-9]+$ ]]
then
zenity --warning --width ${large} --text "Vous devez renseigner un numéro! Merci de recommencer... Seules les vidéos référencées sur The Movie Database sont acceptées." && exit 1
fi
MEDIAID=$CMED
MEDIAKEY="TMDB_$MEDIAID"
# VIDEO TITLE
@ -434,6 +438,8 @@ GENRES="[\"$(echo ${FILM_GENRES} | sed s/\|/\",\"/g)\"]"
###################################
mkdir -p ~/astroport/${CAT}/${MEDIAID}/
mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}"
mv /tmp/screen.png ~/astroport/${CAT}/${MEDIAID}/
if [ $? == 0 ]; then
zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK, nous allons préparer son script d'ajout à Astroport..."
else
@ -619,7 +625,6 @@ FILE_SIZE=$(echo "${FILE_BSIZE}" | awk '{ split( "B KB MB GB TB PB" , v ); s=1;
echo "${MEDIAKEY} = RECORDED TO IPFS."
cat /tmp/${MEDIAKEY}.log
if [ ! $2 ]; then
[ $? == 0 ] && \
zenity --question --width 300 --text "OK! ~/astroport/Add_${MEDIAKEY}_script.sh ($FILE_SIZE). Voulez-vous lancer immédiatement l'ajout dans Astroport ?"; \

View File

@ -284,7 +284,10 @@ rm /tmp/.ipfsid
## ADD "ajouter_video.txt" and "video.json" will be SELF IPNS publish data
## ENCRYPT TO STOP CLEAR DATA LEAKING
[[ -f ~/astroport/${TYPE}/${REFERENCE}/ajouter_video.txt ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/ajouter_video.txt ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/
[[ -f ~/astroport/${TYPE}/${REFERENCE}/video.json ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ && cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/
[[ -f ~/astroport/${TYPE}/${REFERENCE}/screen.png ]] && cp -f ~/astroport/${TYPE}/${REFERENCE}/screen.png ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/
[[ -f ~/astroport/${TYPE}/${REFERENCE}/video.json ]] &&\
cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/ &&\
cp -f ~/astroport/${TYPE}/${REFERENCE}/video.json ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/
########################################################################
########################################################################
@ -413,7 +416,7 @@ then
MIME=$(file --mime-type "$HOME/astroport/${TYPE}/${REFERENCE}/${file}" | cut -d ':' -f 2 | cut -d ' ' -f 2)
if [[ $(echo "$MIME" | grep 'video') ]]; then
TEXT="<video controls><source src='/ipfs/"${IPFSID}"' type='"${MIME}"'></video><h1>"${TITLE}"</h1>"
MIME="txt/html"
MIME="text/vnd.tiddlywiki"
TAGS="${CAT} astroport $GENRE"
CANON=''
else
@ -422,6 +425,9 @@ then
CANON="/ipfs/"${IPFSID}
fi
## Add screen
SCREENDIR=$(ipfs add -wq "${path}screen.png" | tail -n 1)
echo "## Creation json tiddler"
echo '[
{
@ -429,6 +435,7 @@ then
"title": "'${TITLE}'",
"type": "'${MIME}'",
"cat": "'${CAT}'",
"poster": "'${SCREENDIR}/screen.png'",
"ipfsroot": "'${IPFSREPFILEID}'",
"file": "'${file}'",
"mediakey": "'${MEDIAKEY}'",