forgot subtittle for now

This commit is contained in:
fred 2022-12-15 21:06:01 +01:00
parent 43642ced47
commit 44277a87cc
2 changed files with 37 additions and 28 deletions

View File

@ -37,44 +37,45 @@ MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
## CREATE APP NODE PLAYER PUBLICATION DIRECTORY
###################################################################
mkdir -p $HOME/.zen/tmp/$IPFSNODEID/G1CopierYoutube/$PLAYER/
mkdir -p $HOME/.zen/game/players/$PLAYER/G1CopierYoutube/
###################################################################
## tag[CopierYoutube] EXTRACT ~/.zen/tmp/CopierYoutube.json FROM TW
###################################################################
rm -f ~/.zen/tmp/CopierYoutube.json
rm -f ~/.zen/game/players/$PLAYER/G1CopierYoutube/CopierYoutube.json
tiddlywiki --load ${INDEX} \
--output ~/.zen/tmp \
--output ~/.zen/game/players/$PLAYER/G1CopierYoutube \
--render '.' 'CopierYoutube.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[CopierYoutube]]'
echo "DEBUG : cat ~/.zen/tmp/CopierYoutube.json | jq -r"
echo "DEBUG : cat ~/.zen/game/players/$PLAYER/G1CopierYoutube/CopierYoutube.json | jq -r"
BROWSER=$(xdg-settings get default-web-browser | cut -d '.' -f 1 | cut -d '-' -f 1) ## GET cookies-from-browser
###################################################################
## URL EXTRACTION & yt-dlp.cache.$PLAYER upgrade
for YURL in $(cat ~/.zen/tmp/CopierYoutube.json | jq -r '.[].text' | grep 'http'); do
for YURL in $(cat ~/.zen/game/players/$PLAYER/G1CopierYoutube/CopierYoutube.json | jq -r '.[].text' | grep 'http'); do
echo "Detected $YURL"
echo "Extracting video playlist into yt-dlp.cache.$PLAYER"
### yt-dlp.command
CMD=$(cat ~/.zen/tmp/$IPFSNODEID/yt-dlp.command 2>/dev/null | grep "$YURL" | tail -n 1)
CMD=$(cat ~/.zen/game/players/$PLAYER/G1CopierYoutube/yt-dlp.command 2>/dev/null | grep "$YURL" | tail -n 1)
if [[ ! $CMD ]]; then
echo "$PLAYER&$YURL:$MOATS" >> ~/.zen/tmp/$IPFSNODEID/yt-dlp.command
echo "$PLAYER&$YURL:$MOATS" >> ~/.zen/game/players/$PLAYER/G1CopierYoutube/yt-dlp.command
echo "NOUVEAU CANAL $PLAYER&$YURL:$MOATS"
else
lastrun=$(echo "$CMD" | rev | cut -d ':' -f 1 | rev) && echo "$CMD"
duree=$(expr ${MOATS} - $lastrun)
[[ ! $lastrun ]] && echo "$PLAYER&$YURL:$MOATS" >> ~/.zen/tmp/$IPFSNODEID/yt-dlp.command && duree=604800000
[[ ! $lastrun ]] && echo "$PLAYER&$YURL:$MOATS" >> ~/.zen/game/players/$PLAYER/G1CopierYoutube/yt-dlp.command && duree=604800000
# ONE WEEK NEW SCAN
if [[ duree -ge 604800000 ]]; then
yt-dlp --cookies-from-browser $BROWSER --print "%(id)s&%(webpage_url)s" "${YURL}" >> ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$PLAYER
yt-dlp --cookies-from-browser $BROWSER --print "%(id)s&%(webpage_url)s" "${YURL}" >> ~/.zen/game/players/$PLAYER/G1CopierYoutube/yt-dlp.cache.$PLAYER
fi
fi
done # FINISH YURL loop
## SORT UNIQ ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$PLAYER
cat ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$PLAYER | sort | uniq > ~/.zen/tmp/yt-dlp.cache
## CREATE SORT UNIQ ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$PLAYER (12345 ONLINE)
cat ~/.zen/game/players/$PLAYER/G1CopierYoutube/yt-dlp.cache.$PLAYER | sort | uniq > ~/.zen/tmp/yt-dlp.cache
cp ~/.zen/tmp/yt-dlp.cache ~/.zen/tmp/$IPFSNODEID/yt-dlp.cache.$PLAYER
## UPDATE GLOBAL WITH PLAYER & SWARM yt-dlp NEEDS
@ -110,7 +111,7 @@ if [[ ! ${TIDDLER} ]]; then
###################################################################
ZYURL=$(echo "$LINE" | cut -d '&' -f 2-)
echo "COPIE : $ZYURL"
[[ $boucle == 13 ]] && echo "MAXIMUM COPY REACHED" && continue
[[ $boucle == 13 ]] && echo "MAXIMUM COPY REACHED FOR TODAY" && continue
TITLE="$(yt-dlp --cookies-from-browser $BROWSER --print "%(title)s" "${ZYURL}")"
TITLE=${TITLE//[^A-zÀ-ÿ0-9 ]/}
@ -128,14 +129,14 @@ if [[ ! ${TIDDLER} ]]; then
#############################################################################
## COPY FROM YOUTUBE (TODO DOUBLE COPY & MKV to MP4 OPTIMISATION)
## EXTRA PARAM TO TRY
# --cookies-from-browser browser (xdg-settings get default-web-browser) allow member copies
# --dateafter DATE --download-archive myarchive.txt
# --write-subs --write-auto-subs --sub-langs "fr, en, en-orig" --embed-subs
yt-dlp -f "(bv*[ext=mp4][height<=720]+ba/b[height<=720])" \
--cookies-from-browser $BROWSER \
--download-archive $HOME/.zen/.yt-dlp.list \
-S "filesize:700M" --no-mtime --embed-thumbnail --add-metadata \
--write-subs --write-auto-subs --sub-langs "fr, en, en-orig" --embed-subs \
-S res,ext:mp4:m4a --recode mp4 --no-mtime --embed-thumbnail --add-metadata \
-o "$HOME/.zen/tmp/yt-dlp/$TITLE.%(ext)s" ${ZYURL}
################################################################################
### ADAPT TO TW RYTHM (DELAY COPY?)
echo

View File

@ -116,7 +116,7 @@ do
-n "https://data.gchange.fr" \
stars -p ${liking_me} > ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json
## ZOMBIE PROTECTION - TODO PURGE EVERY 60 DAYS
## ZOMBIE PROTECTION - PURGE AFTER 60 DAYS
find ~/.zen/game/players/${PLAYER}/FRIENDS/*.try -mtime +60 -type f -exec rm -f '{}' \;
try=$(cat ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}.try 2>/dev/null)
@ -153,13 +153,13 @@ do
YOU=$(ipfs swarm peers >/dev/null 2>&1 && echo "$USER" || ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2)
echo "$LIBRA/ipns/$FRIENDNS"
echo "http://$myIP:8080/ipns/$FRIENDNS ($YOU)"
echo "http://$myIP:8080/ipns/$FRIENDNS ($FRIENDTITLE)"
# DISPLAY TIMER
${MY_PATH}/displaytimer.sh 17 &
${MY_PATH}/displaytimer.sh 60 &
[[ $YOU ]] && ipfs --timeout 17s cat /ipns/$FRIENDNS > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html
[[ ! -s ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html ]] && curl -m 17 -so ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html "$LIBRA/ipns/$FRIENDNS"
[[ $YOU ]] && ipfs --timeout 60s cat /ipns/$FRIENDNS > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html
[[ ! -s ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html ]] && curl -m 60 -so ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html "$LIBRA/ipns/$FRIENDNS"
## PLAYER TW EXISTING ?
if [ ! -s ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html ]; then
@ -168,28 +168,34 @@ do
echo "AUCUN TW ACTIF. PREVENONS LE"
$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey -n "https://data.gchange.fr" send -d "${liking_me}" -t "HEY BRO !" -m "G1 TW BunkerBOX >>> (⌐■_■) <<< https://ipfs.copylaradio.com/ipns/$ASTRONAUTENS >>> (ᵔ◡◡ᵔ) <<< "
## I TRY
try=$((try+1)) && echo $try > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}.try
else
echo "COOL MON AMI EST SUR IPFS"
FTW="~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html"
echo "COOL MON AMI PUBLIE SUR IPFS : $FTW"
tiddlywiki --load ${FTW} --output ~/.zen/tmp --render '.' "${liking_me}.MadeInZion.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
[[ ! -s ~/.zen/tmp/${liking_me}.MadeInZion.json ]] && echo "~~~ BROKEN $FTW (☓‿‿☓) ~~~" && continue
tiddlywiki --load ${FTW} --output ~/.zen/tmp --render '.' "${liking_me}.MadeInZion.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
[[ ! -s ~/.zen/tmp/${liking_me}.MadeInZion.json ]] && echo "~~~ BROKEN $FTW (☓‿‿☓) BAD ~/.zen/tmp/${liking_me}.MadeInZion.json ~~~" && continue
FPLAYER=$(cat ~/.zen/tmp/${liking_me}.MadeInZion.json | jq -r .[].player)
[[ ! $FPLAYER ]] && echo "NO PLAYER = BAD MadeInZion Tiddler" && continue
## CREATING 30 DAYS RSS STREAM
tiddlywiki --load ${FTW} \
--output ~/.zen/game/players/${PLAYER}/ipfs --render '.' "${FPLAYER}.rss.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-30]]'
[[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.rss.json ]] && echo "NO ${FPLAYER} RSS - CONTINUE -" && continue
[[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.rss.json ]] && echo "NO ${FPLAYER} RSS - BAD ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.rss.json -" && continue
echo "DEBUG RSS : cat ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.rss.json | jq -r"
echo
tiddlywiki --load ${FTW} \
--output ~/.zen/game/players/${PLAYER}/ipfs --render '.' "${FPLAYER}.lightbeam-key.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key'
[[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.lightbeam-key.json ]] && echo "NO ${FPLAYER} lightbeam-key - CONTINUE -" && continue
ASTRONAUTEFEED=$(cat ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.lightbeam-key.json | jq -r .[].text)
echo "DEBUG LIGHTBEAM : cat ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.lightbeam-key.json | jq -r"
echo
## ADD THIS FPLAYER RSS FEED INTO PLAYER TW
## PUSH DATA TO 12345 SWARM KEY
mkdir -p ~/.zen/tmp/${IPFSNODEID}/rss/${PLAYER}
@ -198,12 +204,12 @@ do
export FRIENDSFEEDS="$ASTRONAUTEFEED\n$FRIENDSFEEDS"
echo "$FRIENDSFEEDS" > ~/.zen/tmp/${IPFSNODEID}/rss/${PLAYER}/FRIENDSFEEDS
echo "(☉_☉ ) (☉_☉ ) (☉_☉ )" $FRIENDSFEEDS
echo "(☉_☉ ) (☉_☉ ) (☉_☉ ) : FRIENDSFEEDS=" $FRIENDSFEEDS
export IFRIENDHEAD="<a target='you' href='/ipns/"$FRIENDNS"'>$$FRIENDTITLE</a>$IFRIENDHEAD"
echo "$IFRIENDHEAD" > ~/.zen/tmp/${IPFSNODEID}/rss/${PLAYER}/IFRIENDHEAD
echo "(☉_☉ ) (☉_☉ ) (☉_☉ )" $IFRIENDHEAD
echo "(☉_☉ ) (☉_☉ ) (☉_☉ ) : IFRIENDHEAD=" $IFRIENDHEAD
echo "APP=RSS : PLAYER FPLAYER RSS PUBLICATION READY"
@ -212,7 +218,7 @@ do
fi
## ACTIVER RECUP ANNONCES...
# SCRAPING DONNE LE BON COIN
# SCRAPING DONNE LE BON COIN - DIFFICILE - UTILISER COOKIE NAVIGATEUR
# https://www.leboncoin.fr/recherche?text=donne&locations=Toulouse__43.59743304757555_1.4471155185604894_10000_5000&owner_type=private&sort=time&donation=1
## Get Ŋ2 LEVEL
@ -227,7 +233,9 @@ do
done
else
#########################################
## COOL FEATURE FOR GCHANGE ACCOUNT CONFIDENCE
## IS IT REALLY A FRIEND I LIKE ?
echo "BRO?"
$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey -n "https://data.gchange.fr" send -d "${G1PUB}" -t "Bro ?" -m "https://www.gchange.fr/#/app/user/${liking_me}/"
try=$((try+1)) && echo $try > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}.try