astroport/www/LOVELand/_CopyLaRadio/artist_song_to_sbotc_zenyta.sh

45 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
ARTIST=$1
SONG=$2
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || er+=" ipfs daemon not running"
[[ $er ]] && echo $er
echo '
__
__ _____ ______________ ___ __ / /
/ / / / _ \/ ___/ ___/ __ `/ / / / / /
/ /_/ / __(__ |__ ) /_/ / /_/ / /_/
\__, /\___/____/____/\__,_/\__, / (_)
/____/ /____/
identifying'
echo $ARTIST
echo $SONG
# WHOAMI=$(sbotc whoami | jq -r .id)
# sbotc query.read '{"query":[{"$filter":{"value":{"author": "'"$WHOAMI"'", "content":{"type":"zenyta"}}}}]}' | jq -r .value?.content?.text | tail -n 1
# this command is reagularly is run in cron_MINUTE.sh so your stations then take cae to miammiam.sh your youtube search
#
# We must transform that input information into link to copy from
# We are going to use youtube-dl dry run.
# http://golly.sourceforge.net/
# [@Christian Bundy](@+oaWWDs8g73EZFUMfW37R/ULtFEjwKN/DczvdYihjbU=.ed25519)
# thanks for your security hole spotting..
# I know that this could become a badly used account...
# It will be introduced as a learning account. (being able to regenerate).
# the above algo rythm is calibrated on the "game of life" mixed with angel problem solution.
# will it produce "speeders shapings" i hope...
# %EDlmG9QW2U2wYnvIIKf//GrDxYoQWGL/Jk3Nw0obi8M=.sha256
# http://golly.sourceforge.net/
mysearch="$ARTIST $SONG"
su $YOU -c mkdir -p /home/$YOU/.zen/audio/${ARTIST}/${SONG}/
su $YOU -c youtube-dl --default-search ytsearch1: --download-archive /home/$YOU/.ytdl.list --write-thumbnail --continue --no-overwrites --write-info-json --no-mtime --metadata-from-title "$artist - %(title)s" --embed-thumbnail --ignore-errors --audio-format mp3 --extract-audio -o "/home/$YOU/.zen/music/${artist}/${song}/%(id)s.%(title)s.%(uploader_id)s.%(ext)s" "$mysearch" >> /tmp/youtube-dl.log 2>&1
# Finaly this is made directly....
# so it is not put on ipfs... zenTag must attach contracts...
### COULD BE EXTENDED §§§§
# TODO use sbotc message to benefit from ./zen/ssb_GET_zenyta.sh harvesting