debug zenyta zenytv
This commit is contained in:
parent
26351cd809
commit
3a75618234
|
@ -54,8 +54,15 @@ do
|
|||
author=$(printf %s "$msg" | jq -r .value.author)
|
||||
# echo $author
|
||||
timestamp=$(printf %s "$msg" | jq -r .value.timestamp)
|
||||
[[ $timestamp == $last_ts ]] && echo "ALREADY DONE" && continue
|
||||
# echo $timestamp
|
||||
|
||||
# TEST CURRENT NODE last_ts
|
||||
[[ $timestamp == $last_ts ]] && echo "ALREADY DONE" && continue
|
||||
|
||||
# TEST if SWARM already made it.
|
||||
CHECKSWARM=$(grep -Rwl "$timestamp" ~/.zen/ipfs_swarm/.Qm*/TAG/*/_tag.zensource | tail -n 1 | cut -f 4 -d '/')
|
||||
[[ $CHECKSWARM ]] && echo "$timestamp ALREADY on NODE $CHECKSWARM. CONTINUE" && continue
|
||||
|
||||
msg_root=$(printf %s "$msg" | jq -r .value.content.root)
|
||||
# echo $msg_root
|
||||
msg_branch=$(printf %s "$msg" | jq -r .value.content.branch)
|
||||
|
@ -74,14 +81,9 @@ mkdir -p ~/.zen/miam/$timestamp
|
|||
--no-mtime -o "~/.zen/miam/$timestamp/%(id)s.%(ext)s" $msg_ytdlurl
|
||||
|
||||
# REFERENCE msg_key AND timestamp
|
||||
echo "$timestamp" > ~/.zen/zenytv.last.ts
|
||||
echo "$timestamp" > ~/.zen/zenyta.last.ts
|
||||
echo "$msg_key" > ~/.zen/miam/$timestamp/msg_key
|
||||
|
||||
rm ~/.zen/zenyta.last.ts
|
||||
# rm ~/.zen/zenyta.last.ts
|
||||
|
||||
done < <(printf '%s\n' "$messages")
|
||||
|
||||
# AH AH AH ! My little mouse is shy ;)
|
||||
#youtube-dl -x --no-mtime --audio-format mp3 -o "~/.zen/miam/$timestamp/%(title)s.%(id)s.%(ext)s" https://www.youtube.com/watch?v=jdVZwhdGqJU
|
||||
#[youtube] jdVZwhdGqJU: Downloading webpage
|
||||
#ERROR: unable to download video data: HTTP Error 403: Forbidden
|
||||
|
|
|
@ -32,7 +32,7 @@ self_name=$(sbotc query.read '{"query":[{"$filter":{"value":{"author": "'"$self"
|
|||
ipfsnodeid=$(ipfs id -f='<id>\n')
|
||||
|
||||
current_ts=$(date -u +%s%N | cut -b1-13)
|
||||
[ -f ~/.zen/zenytv.last.ts ] && last_ts=$(cat ~/.zen/zenytv.last.ts) || last_ts=$((current_ts - 100*24*3600*1000 - 1)) # 100*24h ago
|
||||
[ -f ~/.zen/zenytv.last.ts ] && last_ts=$(cat ~/.zen/zenytv.last.ts) || last_ts=$((current_ts - 10*24*3600*1000 - 1)) # 10*24h ago
|
||||
|
||||
echo "
|
||||
_
|
||||
|
@ -54,8 +54,15 @@ do
|
|||
author=$(printf %s "$msg" | jq -r .value.author)
|
||||
# echo $author
|
||||
timestamp=$(printf %s "$msg" | jq -r .value.timestamp)
|
||||
[[ $timestamp == $last_ts ]] && echo "ALREADY DONE" && continue
|
||||
# echo $timestamp
|
||||
|
||||
# TEST CURRENT NODE last_ts
|
||||
[[ $timestamp == $last_ts ]] && echo "ALREADY DONE" && continue
|
||||
|
||||
# TEST if SWARM already made it.
|
||||
CHECKSWARM=$(grep -Rwl "$timestamp" ~/.zen/ipfs_swarm/.Qm*/TAG/*/_tag.zensource | tail -n 1 | cut -f 4 -d '/')
|
||||
[[ $CHECKSWARM ]] && echo "$timestamp ALREADY on NODE $CHECKSWARM. CONTINUE" && continue
|
||||
|
||||
msg_root=$(printf %s "$msg" | jq -r .value.content.root)
|
||||
# echo $msg_root
|
||||
msg_branch=$(printf %s "$msg" | jq -r .value.content.branch)
|
||||
|
@ -77,6 +84,6 @@ mkdir -p ~/.zen/miam/$timestamp
|
|||
echo "$timestamp" > ~/.zen/zenytv.last.ts
|
||||
echo "$msg_key" > ~/.zen/miam/$timestamp/msg_key
|
||||
|
||||
rm ~/.zen/zenytv.last.ts # DEBUG
|
||||
# rm ~/.zen/zenytv.last.ts # DEBUG
|
||||
|
||||
done < <(printf '%s\n' "$messages")
|
||||
|
|
|
@ -251,10 +251,20 @@ cat > ~/.zen/tag/${AAH}/_passenger.contract.sh <<EOF
|
|||
#!/bin/bash
|
||||
# THIS CODE INITIATE A CONTRACT
|
||||
# ASK to "_ipfs.node.creator" (send ZenTag or G1TX)
|
||||
echo "New Contract (hit ENTER)"
|
||||
read
|
||||
|
||||
echo "To get access to file : $PASSENGERNAME
|
||||
- Give $READ Zen to $ipfsnodeid
|
||||
Once received "
|
||||
|
||||
# so it create a "_passenger.ipfs.NodeN.crypt"
|
||||
# ADD NodeN as a consumer (first are partners)
|
||||
# ADD NodeN as a consumer (each new listener is a relative partners)
|
||||
# Each day File will pay each BB key owners
|
||||
# By one
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
exit 0
|
||||
EOF
|
||||
|
||||
|
@ -397,17 +407,13 @@ root: $msg_root
|
|||
branch: $msg_branch
|
||||
"
|
||||
echo "$MESSAGE"
|
||||
INLINE=$(node -p "JSON.stringify(process.env.MESSAGE)" | sed 's/,/ /g')
|
||||
INLINE=$(node -p "JSON.stringify(process.env.MESSAGE)")
|
||||
|
||||
echo '{"type":"post", "branch": "'"$msg_branch"'", "root": "'"$msg_root"'", "text":'${INLINE}',"mentions":[{"link":"'"$id"'","name":"'"$name"'","size":"'"$size"'","type":"'"$type"'"},{"link":"#zenbot"},{"link":"#astroport"}]}'
|
||||
|
||||
# sbotc publish '{"type":"post","text":"'"$MESSAGE"'", "branch": "'"$msg_branch"'", "root": "'"$msg_root"'"}' #2>&1>/dev/null
|
||||
# TODO: Remove coma replacing space
|
||||
# echo '{"type":"post", "branch": "'"$msg_branch"'", "root": "'"$msg_root"'", "text":'${INLINE}',"mentions":[{"link":"'"$id"'","name":"'"$name"'","size":"'"$size"'","type":"'"$type"'"},{"link":"#zenbot"},{"link":"#astroport"}]}'
|
||||
sbotc publish '{"type":"post", "branch": "'"$msg_branch"'", "root": "'"$msg_root"'", "text":'${INLINE}',"mentions":[{"link":"'"$id"'","name":"'"$name"'","size":"'"$size"'","type":"'"$type"'"},{"link":"#zenbot"},{"link":"#astroport"}]}'
|
||||
|
||||
|
||||
# sbotc publish '{"type":"post","text":"${extra} ... ZenTAG created : ipfs ls /ipns/$J"}'
|
||||
# SECURITY IS OBSOLETE AS WE ARE YUST SHARING COPY WITH FRIENDS ;)
|
||||
|
||||
fi
|
||||
|
||||
########################################################################
|
||||
|
|
Loading…
Reference in New Issue