diff --git a/ajouter_video.sh b/ajouter_video.sh index 08b0765..e669c85 100755 --- a/ajouter_video.sh +++ b/ajouter_video.sh @@ -211,8 +211,6 @@ rm -Rf ${YTEMP} # CASE ## WEB web) - zenity --warning --width 600 --text 'DEVELOPPEMENT . ZONE . Please Participate https://git.p2p.legal' - ## wget current URL -> index.html ## TEST ## TEST httrack ?? [[ ! $(which httrack) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de site web absent.. Lancez la commande 'sudo apt install httrack'" && exit 1 echo "httrack --mirror $URL" @@ -223,10 +221,12 @@ rm -Rf ${YTEMP} FILE_PATH="$HOME/astroport/web/$MEDIAID"; mkdir -p $FILE_PATH - wget -mpck --user-agent="" -e robots=off --wait 1 "$URL" > ${FILE_PATH}/${FILE_NAME} + wget -mpck --user-agent="" -e robots=off --wait 1 "$URL" > ${FILE_PATH}/ echo "web;${MEDIAID};$(date -u +%s%N | cut -b1-13);${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt + zenity --warning --width ${large} --text "VĂ©rifiez que la copie de votre site se trouve bien dans ${FILE_PATH}/" + ;; @@ -234,8 +234,6 @@ rm -Rf ${YTEMP} # CASE ## PAGE page) - zenity --warning --width 600 --text 'DEV . ZONE . Please Participate https://git.p2p.legal' - ## record one page to PDF [[ ! $(which chromium) ]] && zenity --warning --width ${large} --text "Utilitaire de copie de page web absent.. Lancez la commande 'sudo apt install chromium'" && exit 1 cd /tmp/ && rm -f output.pdf @@ -444,6 +442,7 @@ else fi FILE_NAME="${TITLE}.${FILE_EXT}" + ## CREATE "~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt" URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri) echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt @@ -533,6 +532,12 @@ echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};_IPNSKEY_;${RES};/i esac +## Extract thumbnail +MIME=$(file --mime-type $HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} | cut -d ' ' -f 2) + +[[ $(echo $MIME | grep video) ]] && ffmpeg -i $HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} -r 1/300 -vf scale=-1:120 -vcodec png $HOME/astroport/${CAT}/${MEDIAID}/${CAT}.png +[[ ! -f /astroport/${CAT}/${MEDIAID}/${CAT}.png ]] && echo "DEFAULT THUMBNAIL NEEDED" + ######################################################################## # ADD $FILE to IPFS / ASTROPORT / KODI echo "new_file_in_astroport.sh \"$HOME/astroport/${CAT}/${MEDIAID}/\" \"${FILE_NAME}\"" diff --git a/zen/new_file_in_astroport.sh b/zen/new_file_in_astroport.sh index dba5af6..6883b91 100755 --- a/zen/new_file_in_astroport.sh +++ b/zen/new_file_in_astroport.sh @@ -430,7 +430,11 @@ echo '[ "_canonical_uri": "/ipfs/'${IPFSREPFILEID}'/'${URLENCODE_FILE_NAME}'" } ] -' > ~/astroport/${TYPE}/${MEDIAKEY}.dragdrop.json +' > ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json + +# COPY TO DESKTOP Journal +[[ "$USER" != "xbian" && -d ~/Bureau ]] && mkdir -p ~/Bureau/Journal && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Bureau/Journal/ +[[ "$USER" != "xbian" && -d ~/Desktop ]] && mkdir -p ~/Desktop/Journal && cp ~/astroport/${TYPE}/${REFERENCE}/${MEDIAKEY}.dragdrop.json ~/Desktop/Journal/ fi @@ -471,4 +475,5 @@ echo "#### EXCECUTION TIME" end=`date +%s` echo Execution time was `expr $end - $start` seconds. echo "########################################################################" +zenity --warning --width 300 --text "Votre MEDIA a rejoint ASTROPORT en `expr $end - $start` secondes" exit 0