added gumi

also started adding miku.
This commit is contained in:
2026-05-03 09:12:56 -04:00
parent 135b7e5da8
commit 575df2eaf9
8 changed files with 203040 additions and 98 deletions
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
{ "lastDate": "2026-04-27T00:00:00Z" }
+1
View File
@@ -0,0 +1 @@
{"lastDate": "2026-05-02T00:00:00Z"}
+32 -53
View File
@@ -1,9 +1,26 @@
#!/usr/bin/bash #!/usr/bin/bash
ARTIST=140308 # 116 is Kasane Teto #
# updated 5-2-26 to use other singer IDs so i can get songs from other singer IDs, miku is 1.
#
while [ $# -gt 0 ]; do export "${1#-}"="$2"; shift 2; done # argument handling
if [ -z "$s" ]; then export ARTIST=140308; else export ARTIST=$s; fi # default to Kasane Teto if no singer ID is specified
if [ -z "$a" ]; then export ART="▼・ᴗ・▼"; else export ART="$a"; fi # default to ▼・ᴗ・▼ if no art is specified
if [ -z "$n" ]; then export vsynth="TETO"; else export vsynth="$n"; fi # default to TETO if no vsynth is specified
if [ -z "$p" ]; then export preset="none"; else export preset="$p"; fi # option for presetting singer ID, art, and vsynth
if [ $preset = "Teto" ]; then export ARTIST=140308; export ART="▼・ᴗ・▼"; export vsynth="TETO"; fi # preset for Teto
if [ $preset = "Miku" ]; then export ARTIST=1; export ART="⎛⎝・ᴗ・⎠⎞ ა🥬"; export vsynth="MIKU"; fi # preset for Miku
if [ $preset = "Gumi" ]; then export ARTIST=3; export ART="💚🥕🎤💚"; export vsynth="GUMI"; fi # preset for Gumi
echo "vsynth: $vsynth"
echo "ARTIST: $ARTIST"
echo "ART: $ART"
#ARTIST=140308 # 116 is Kasane Teto
CHILDREN="true" # If we want child voicebanks, we do so we can get all songs from utau, sv, and sv2 CHILDREN="true" # If we want child voicebanks, we do so we can get all songs from utau, sv, and sv2
START=0 # Start at the beginning of the recordset. if i wanted to make the file in chunks to use the api less i would use this and max to get the songs in chunks. They say dont use it "thousands of times a day", getting every teto song is 280 times. I think I'm ok. maybe. START=0 # Start at the beginning of the recordset. if i wanted to make the file in chunks to use the api less i would use this and max to get the songs in chunks. They say dont use it "thousands of times a day", getting every teto song is 280 times. I think I'm ok. maybe.
RESULTS=100 # Max results. Limit is 100. RESULTS=100 # Max results. Limit is 100.
MAX=30000 # when to stop, there's as of 4-23-26 over 28,000 songs featuring Kasane Teto in the recordset i have selected. MAX=100000 # when to stop, 100,000 is 1000 uses of the api, there's like 70k miku songs total so this **should** be ok. A thousand isnt thousands.
if [ ! -f dates/${ARTIST}var.json ]; then # var.json has our latest date, we use it to know where to stop going back, past it the songs already exist in the fortune file. if [ ! -f dates/${ARTIST}var.json ]; then # var.json has our latest date, we use it to know where to stop going back, past it the songs already exist in the fortune file.
echo '{"lastDate": "2000-04-21T00:00:00Z"}' > dates/${ARTIST}var.json # if it doesn't exist, we create it with a default date back in 2000. echo '{"lastDate": "2000-04-21T00:00:00Z"}' > dates/${ARTIST}var.json # if it doesn't exist, we create it with a default date back in 2000.
fi fi
@@ -14,84 +31,46 @@ echo "Result: $AFTERDATE"
# setting the latest date. just pulling the latest song from the api and setting the createDate as the latest date in var.json for use when we update the fortune file again, dont want to add the same songs twice. idk how I'll handle broken links and such, maybe just regenerate the whole thing periodically. # setting the latest date. just pulling the latest song from the api and setting the createDate as the latest date in var.json for use when we update the fortune file again, dont want to add the same songs twice. idk how I'll handle broken links and such, maybe just regenerate the whole thing periodically.
CURLURL="https://vocadb.net/api/songs?songTypes=Original&afterDate=${AFTERDATE}&&artistId%5B%5D=${ARTIST}&childVoicebanks=${CHILDREN}&onlyWithPvs=true&status=Finished&start=0&maxResults=1&sort=PublishDate&fields=PVs" CURLURL="https://vocadb.net/api/songs?songTypes=Original&afterDate=${AFTERDATE}&&artistId%5B%5D=${ARTIST}&childVoicebanks=${CHILDREN}&onlyWithPvs=true&status=Finished&start=0&maxResults=1&sort=PublishDate&fields=PVs"
echo "CURLURL: $CURLURL" echo "CURLURL: $CURLURL"
DATA=$(curl -X 'GET' \ DATA=$(curl -X 'GET' $CURLURL -H 'accept: application/json')
$CURLURL \
-H 'accept: application/json')
# making sure there are songs to add. # making sure there are songs to add.
SONGS=$(echo "$DATA" | jq -c '.items | length') SONGS=$(echo "$DATA" | jq -c '.items | length')
if [ "$SONGS" -eq 0 ]; then if [ "$SONGS" -eq 0 ]; then echo "Result is empty. No more songs."; exit 0; fi
echo "Result is empty. No more songs."
exit 0
fi
DATE=$(date -u +%Y-%m-%dT00:00:00Z) DATE=$(date -u +%Y-%m-%dT00:00:00Z)
echo "DATE: $DATE" echo "DATE: $DATE"
echo "{\"lastDate\": \"$DATE\"}" > dates/${ARTIST}var.json echo "{\"lastDate\": \"$DATE\"}" > dates/${ARTIST}var.json
# looping the api to get all songs we need. # looping the api to get all songs we need.
while true; do while true; do
CURLURL="https://vocadb.net/api/songs?songTypes=Original&afterDate=${AFTERDATE}&&artistId%5B%5D=${ARTIST}&childVoicebanks=${CHILDREN}&onlyWithPvs=true&status=Finished&start=${START}&maxResults=${RESULTS}&sort=PublishDate&fields=PVs" CURLURL="https://vocadb.net/api/songs?songTypes=Original&afterDate=${AFTERDATE}&&artistId%5B%5D=${ARTIST}&childVoicebanks=${CHILDREN}&onlyWithPvs=true&status=Finished&start=${START}&maxResults=${RESULTS}&sort=PublishDate&fields=PVs"
DATA=$(curl -X 'GET' \ DATA=$(curl -X 'GET' $CURLURL -H 'accept: application/json')
$CURLURL \
-H 'accept: application/json')
SONGS=$(echo "$DATA" | jq -r '.items | length') SONGS=$(echo "$DATA" | jq -r '.items | length')
if [ "$SONGS" -eq 0 ]; then if [ "$SONGS" -eq 0 ]; then echo "Result is empty. No more songs."; break
echo "Result is empty. No more songs."
break
else else
START=$((START + SONGS)) START=$((START + SONGS))
echo "Found songs! Processing... (Total fetched: $START)" echo "Found songs! Processing... (Total fetched: $START)"
echo "$DATA" | jq -r '.items[] | [.artistString, .defaultName, .pvs[0].url] | @tsv' | while IFS=$'\t' read -r artist name url; do echo "$DATA" | jq -r '.items[] | [.artistString, .defaultName, .pvs[0].url] | @tsv' | while IFS=$'\t' read -r artist name url; do
echo "TETO SONG OF THE DAY!" echo "$vsynth SONG OF THE DAY!" && echo "" && echo "$artist -- $name" && echo "" && echo "$url" && echo "" && echo "$ART" && echo "\`"
echo ""
echo "$artist -- $name"
echo ""
echo "$url"
echo ""
echo "▼・ᴗ・▼"
echo "\`"
done >> vocafortunes/vocadb/$ARTIST done >> vocafortunes/vocadb/$ARTIST
if [ "$START" -ge "$MAX" ]; then if [ "$START" -ge "$MAX" ]; then echo "Reached max results. Stopping."; break; fi
echo "Reached max results. Stopping."
break
fi
echo "Done!" echo "Done!"
fi fi
done done
readarray -d '`' tetosongs < vocafortunes/vocadb/$ARTIST # check for duplicates and save the file again.
readarray -td '' dups < <( readarray -d '`' tetosongs < vocafortunes/vocadb/$ARTIST
(( ${#tetosongs[@]} == 0 )) || readarray -td '' dups < <((( ${#tetosongs[@]} == 0 )) || printf '%s\0' "${tetosongs[@]}" | LC_ALL=C sort -z | LC_ALL=C uniq -zd)
printf '%s\0' "${tetosongs[@]}" | readarray -td '' uniq < <((( ${#tetosongs[@]} == 0 )) || printf '%s\0' "${tetosongs[@]}" | LC_ALL=C sort -z | LC_ALL=C uniq -zu)
LC_ALL=C sort -z |
LC_ALL=C uniq -zd
)
readarray -td '' uniq < <(
(( ${#tetosongs[@]} == 0 )) ||
printf '%s\0' "${tetosongs[@]}" |
LC_ALL=C sort -z |
LC_ALL=C uniq -zu
)
echo ${#tetosongs[@]} echo ${#tetosongs[@]}
if ((${#dups[@]} > 0)); then if ((${#dups[@]} > 0)); then echo >&2 "array has duplicates:"; echo ${#dups[@]};fi
echo >&2 "array has duplicates:" if ((${#uniq[@]} > 0)); then echo >&2 "Uniques:"; echo ${#uniq[@]};fi
echo ${#dups[@]}
fi
if ((${#uniq[@]} > 0)); then
echo >&2 "Uniques:"
echo ${#uniq[@]}
fi
printf >&2 '%s' "${dups[@]}" > dups printf >&2 '%s' "${dups[@]}" > dups
printf >&2 '%s' "${uniq[@]}" > uniq printf >&2 '%s' "${uniq[@]}" > uniq
cat uniq > fixed cat uniq > fixed
cat dups >> fixed cat dups >> fixed
sed -i '1,/^TETO SONG OF THE DAY!/{/^TETO SONG OF THE DAY!$/!d}' fixed sed -i "1,/^${vsynth} SONG OF THE DAY!$/{/^${vsynth} SONG OF THE DAY!$/!d}" fixed
rm vocafortunes/vocadb/$ARTIST rm vocafortunes/vocadb/$ARTIST
rm uniq dups rm uniq dups
mv fixed vocafortunes/vocadb/$ARTIST mv fixed vocafortunes/vocadb/$ARTIST
# create the fortune database from tetofortunes
#rm tetofortunes.dat # delete the old database if it extists.
#strfile -c % tetofortunes tetofortunes.dat
+51 -42
View File
@@ -1,52 +1,61 @@
#!/usr/bin/bash #!/usr/bin/env bash
# #
# Updated 5-1-26 to use new vocafortune script and not require fortune/misfortune. # Updated 5-1-26 to use new vocafortune script and not require fortune/misfortune.
# Updated 5-2-26 to add Miku and Gumi presets and shorten what i can just to see if i could.
# #
#
# argument handling # argument handling
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do case $1 in
case $1 in -u|--update) echo "Downloading tetosong updater..." && bash <(curl -s https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/autoupdater/updater.sh) && exit 0 ;; # update tetosong
-u|--update) -h|--help) echo -e " --- TETOSONG HELP ---\n -h | display this message \n -u | update script and fortunes \n -p SINGER | set singer preset (Teto, Gumi)"; exit 0 ;; # tetosong help
echo "Downloading tetosong updater..." *) break ;;
bash <(curl -s https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/autoupdater/updater.sh) esac done
shift while [ $# -gt 0 ]; do export "${1#-}"="$2"; shift 2; done # additional argument handling
exit 0 if [ -z "$p" ]; then export preset="Teto"; else export preset="$p"; fi # option for presetting singer preset
;; if [ ! -f ~/.local/share/tetosong/tetosong.config ]; then echo "Config file not found, downloading default..." # check if the config file exists, if not download it
-h|--help)
echo "--- TETOSONG HELP ---"
echo ""
echo " -h | display this message"
echo " -u | update script and fortunes"
echo ""
shift
exit 0
;;
*)
break
;;
esac
done
# check if the config file exists, if not download it
if [ ! -f ~/.local/share/tetosong/tetosong.config ]; then
echo "Config file not found, downloading default..."
curl -sLo ~/.local/share/tetosong/tetosong.config https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/tetosong.config curl -sLo ~/.local/share/tetosong/tetosong.config https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/tetosong.config
fi fi
# check if the user wants to play audio # check if the user wants to play audio
AUDIO="$(. ~/.local/share/tetosong/tetosong.config; echo $AUDIO)" AUDIO="$(. ~/.local/share/tetosong/tetosong.config; echo $AUDIO)"
# run based on preset
vocafortune >> /tmp/fortune if [ "$preset" = "Teto" ]; then vocafortune -f "$HOME/.local/share/tetosong/vocafortunes/vocadb/140308" >> /tmp/fortune # Teto Preset, the default
if [ "$AUDIO" = "YES" ]; then if [ "$AUDIO" = "YES" ]; then
if grep -q "SV2" /tmp/fortune; then if grep -q "SV2" /tmp/fortune; then nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/sv2SOTD.wav 2>/dev/null >/dev/null &
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/sv2SOTD.wav 2>/dev/null >/dev/null & elif grep -q "SV" /tmp/fortune; then nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/svSOTD.wav 2>/dev/null >/dev/null &
elif grep -q "SV" /tmp/fortune; then elif grep -q "重音テト" /tmp/fortune; then nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/utSOTD.wav 2>/dev/null >/dev/null &
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/svSOTD.wav 2>/dev/null >/dev/null & else nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/sv2SOTD.wav 2>/dev/null >/dev/null & fi
elif grep -q "重音テト" /tmp/fortune; then fi
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/utSOTD.wav 2>/dev/null >/dev/null & elif [ "$preset" = "Miku" ]; then if [ ! -f ~/.local/share/tetosong/vocafortunes/vocadb/1 ]; then echo "Miku not found, downloading..." # Miku Preset (check if her songs are installed then install if not)
else cat << 'EOF' > $HOME/.local/bin/mikusong
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/sv2SOTD.wav 2>/dev/null >/dev/null & #!/usr/bin/env bash
tetosong -p Miku
exit 0
EOF
chmod +x $HOME/.local/bin/mikusong
curl -sLo ~/.local/share/tetosong/vocafortunes/vocadb/1 https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/vocafortunes/vocadb/1 # this doesnt actually exist yet.
if [ "$AUDIO" = "YES" ]; then curl -sLo ~/.local/share/tetosong/audio/miku/v6SOTD.wav https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/audio/miku/v6SOTD.wav; fi
fi
vocafortune -f "$HOME/.local/share/tetosong/vocafortunes/vocadb/1" >> /tmp/fortune
if [ "$AUDIO" = "YES" ]; then if grep -q "MIKU" /tmp/fortune; then nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/miku/v6SOTD.wav 2>/dev/null >/dev/null & fi fi
elif [ "$preset" = "Gumi" ]; then if [ ! -f ~/.local/share/tetosong/vocafortunes/vocadb/3 ]; then echo "Gumi not found, downloading..." # Gumi Preset (check if her songs are installed then install if not)
cat << 'EOF' > $HOME/.local/bin/gumisong
#!/usr/bin/env bash
tetosong -p Gumi
exit 0
EOF
chmod +x $HOME/.local/bin/gumisong
curl -sLo ~/.local/share/tetosong/vocafortunes/vocadb/3 https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/vocafortunes/vocadb/3
if [ "$AUDIO" = "YES" ]; then curl -sLo ~/.local/share/tetosong/audio/gumi/sv2SOTD.wav https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/audio/gumi/sv2SOTD.wav; fi
fi
vocafortune -f "$HOME/.local/share/tetosong/vocafortunes/vocadb/3" >> /tmp/fortune
if [ "$AUDIO" = "YES" ]; then if grep -q "GUMI" /tmp/fortune; then nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/gumi/sv2SOTD.wav 2>/dev/null >/dev/null & fi fi
elif [ "$preset" = "all" ]; then # All Preset, pick from any of the avaailable presets. at some point i'll probably make this just pick a random preset instead of making it every preset in one. would get wild if i added a few more voices.
vocafortune -l "$HOME/.local/share/tetosong/vocafortunes/" >> /tmp/fortune
if [ "$AUDIO" = "YES" ]; then
if grep -q "SV2" /tmp/fortune; then nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/sv2SOTD.wav 2>/dev/null >/dev/null &
elif grep -q "SV" /tmp/fortune; then nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/svSOTD.wav 2>/dev/null >/dev/null &
elif grep -q "重音テト" /tmp/fortune; then nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/utSOTD.wav 2>/dev/null >/dev/null &
elif grep -q "MIKU" /tmp/fortune; then nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/miku/v6SOTD.wav 2>/dev/null >/dev/null &
elif grep -q "GUMI" /tmp/fortune; then nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/gumi/sv2SOTD.wav 2>/dev/null >/dev/null & fi
fi fi
fi fi
cat /tmp/fortune cat /tmp/fortune && rm /tmp/fortune
rm /tmp/fortune
+4 -3
View File
@@ -1,10 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# VOCAFORTUNE! Make tetosong not need fortune anymore! # VOCAFORTUNE! Make tetosong not need fortune anymore! Updated 5-2-26 allow using a specific file instead of a directory.
while [ $# -gt 0 ]; do export "${1#-}"="$2"; shift 2; done # now it can be -l ./vocafortunes like a proper program!!!! # argument handling # i can use this anywhere!!!!!!! save this you!!!!!! while [ $# -gt 0 ]; do export "${1#-}"="$2"; shift 2; done # now it can be -l ./vocafortunes like a proper program!!!! # argument handling # i can use this anywhere!!!!!!! save this you!!!!!!
#fortune script #fortune script
shopt -s globstar shopt -s globstar
if [ -z "$l" ]; then export "DIR"="$HOME/.local/share/tetosong/vocafortunes/**"; else export "DIR"="$l/**"; fi if [ -z "$f" ]; then if [ -z "$l" ]; then export "DIR"="$HOME/.local/share/tetosong/vocafortunes/**"; else export "DIR"="$l/**"; fi; else export "FILE"="$f"; fi
for file in $DIR; do if [[ -f "$file" ]]; then readarray -td '`' temp < "$file"; array+=("${temp[@]}"); fi; done if [ -z "$FILE" ]; then for file in $DIR; do if [[ -f "$file" ]]; then readarray -td '`' temp < "$file"; array+=("${temp[@]}"); fi; done
else if [[ -f "$FILE" ]]; then readarray -td '`' temp < "$FILE"; array+=("${temp[@]}"); fi; fi
export "ITEMS"="${#array[@]}" export "ITEMS"="${#array[@]}"
export "CHOICE"="$(shuf -i 1-$ITEMS -n 1)" export "CHOICE"="$(shuf -i 1-$ITEMS -n 1)"
echo "${array[$CHOICE]}" echo "${array[$CHOICE]}"
+202951
View File
File diff suppressed because it is too large Load Diff