more is better but less is best

This commit is contained in:
fred 2024-04-24 16:26:20 +02:00
parent 48df6ceb7a
commit d397e94ec2
4 changed files with 17 additions and 6 deletions

View File

@ -184,7 +184,7 @@ while read LINE;
echo "COPYING MP3 (!-q)"
/usr/local/bin/yt-dlp -x --no-mtime --audio-format mp3 --embed-thumbnail --add-metadata \
$BROWSER \
--download-archive ${HOME}/.zen/.yt-dlp.list \
--download-archive ${HOME}/.zen/.yt-dlp.mp3.list \
-o "${HOME}/.zen/tmp/yt-dlp/$TITLE.%(ext)s" "${ZYURL}"
ZFILE="$TITLE.mp3"
@ -239,7 +239,7 @@ while read LINE;
{{!!filesize}} - {{!!duration}} sec. - vtratio(dur) = {{!!vtratio}} ({{!!dur}})
<br>
<h1><a target='_blank' href='"${ZYURL}"'>Web2.0 Tube</a></h1>"
FOLDER="/MP4"
else
TEXT="<audio controls>
<source src='/ipfs/"${ILINK}"' type='"${MIME}"'>
@ -249,7 +249,7 @@ while read LINE;
{{!!filesize}} - {{!!duration}} sec. - vtratio(dur) = {{!!vtratio}} ({{!!dur}})
<br>
<h1><a target='_blank' href='"${ZYURL}"'>Web2.0 Tube</a></h1>"
FOLDER="/MP3"
fi
end=`date +%s`
@ -274,7 +274,7 @@ while read LINE;
"giftime": "'${PROBETIME}'",
"gifanime": "'/ipfs/${ANIMH}'",
"modified": "'${MOATS}'",
"title": "'${FOLDER}/${ZFILE}'",
"title": "'${ZFILE}'",
"type": "'text/vnd.tiddlywiki'",
"vtratio": "'${VTRATIO}'",
"text": "'$TEXT'",

View File

@ -31,6 +31,7 @@ if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
## COPY STATION yt-dlp.list
cp $HOME/.zen/.yt-dlp.list ~/.zen/tmp/${IPFSNODEID}/yt-dlp.list
cp $HOME/.zen/.yt-dlp.mp3.list ~/.zen/tmp/${IPFSNODEID}/yt-dlp.mp3.list
## COPY COINS VALUE OF THE DAY
rm -Rf ~/.zen/tmp/${IPFSNODEID}/COINS/

View File

@ -489,7 +489,7 @@ for PLAYER in ${PLAYERONE[@]}; do
#### UPlanetZINE/day${days}/index.${lang}.html
TODAYZINE="${MY_PATH}/../templates/UPlanetZINE/day${days}/index.${lang}.html"
[[ ! -s ${TODAYZINE} ]] && TODAYZINE="${MY_PATH}/../templates/UPlanetZINE/day${days}/index.html"
[[ -s ${TODAYZINE} ]] \
[[ -s ${TODAYZINE} && ${days} -gt 0 ]] \
&& echo "SENDING TODAYZINE DAY ${days} + mailjet TW import " \
&& ${MY_PATH}/../tools/mailjet.sh "${PLAYER}" ${TODAYZINE} "ZINE #${days}" "${HOME}/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html" \
|| echo "NO ZINE FOR DAY ${days}"

View File

@ -55,11 +55,15 @@ if [[ -s ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json ]]; then
todate=$(echo "$intercom" | rev | cut -d ':' -f 2 | rev)
echo "SYNC ~/.zen/tmp/${MOATS}/${UMAP} <=> $ipfs_pop"
## TODO: SECURITY PATCH : check payment emitter is from BOOSTRAP
if [[ $ipfs_pop ]]; then
echo "FOUND $todate MEMORY SLOT"
g1pub=$(jq -r '.[] | select(.comment | test("UPLANET:'"${UMAP}"'")) | .pubkey' ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json | tail -n 1)
echo "INFO :: $g1pub Memory updater"
## ADD SECURITY : check payment emitter is a "BOOSTRAP" (TODO)
nodeid=$(${MY_PATH}/../tools/g1_to_ipfs.py $g1pub)
ipfs --timeout 360s get --progress="false" -o ~/.zen/tmp/${MOATS}/${UMAP} $ipfs_pop \
&& ipfs pin rm $ipfs_pop \
|| echo "$ipfs_pop ERROR ... "
@ -67,6 +71,12 @@ if [[ -s ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json ]]; then
echo "WARNING cannot revover any memory !!"
fi
## REMOVE PREVIOUS PIN (in case last one was not mine)
antecom=$(jq -r '.[] | select(.comment | test("UPLANET:'"${UMAP}"'")) | .comment' ~/.zen/tmp/${MOATS}/${SECTOR}.g1history.json | tail -n 2 | head -n 1)
ipfs_b=$(echo "$antecom" | rev | cut -d ':' -f 1 | rev)
[[ ! -z ${ipfs_b} ]] && ipfs pin rm ${ipfs_b}
else
echo "FATAL ERROR cannot access to SECTORG1PUB history"
exit 1