23 Commits

Author SHA1 Message Date
eric 6dfba965ab Update automakefortune.sh 2026-07-09 17:33:37 -04:00
eric 67a03c91ae Update automakefortune.sh 2026-07-09 17:31:02 -04:00
eric 5077158e7b update fortune files. dw, not abandoned, just me being busy lol 2026-07-09 14:05:52 -04:00
eric 064fe096ae update songs
update songs on 6-3-26
2026-06-03 09:51:33 -04:00
eric 2c43164e9b song updates and fixes
gumi and miku download their audio properly now.
2026-05-22 14:54:20 -04:00
eric b572219679 Add miku + small fixes to small issues
Added limited Miku: around 400 songs from 4-27-26 to now.

update to makefortune fetch date so we dont miss songs
small fix to updater (it'll update Gumi now)
added command reference.
2026-05-13 00:39:49 -04:00
eric 23c931c1dd Song update
Update songs for gumi and teto
2026-05-12 22:43:58 -04:00
eric 575df2eaf9 added gumi
also started adding miku.
2026-05-03 09:12:56 -04:00
eric 135b7e5da8 Update README.md 2026-05-02 01:06:53 -04:00
eric cccddb7045 Merge pull request #3 from eric5949/testing
Testing
2026-05-02 01:05:23 -04:00
eric d9372881bf Merge branch 'main' into testing 2026-05-02 01:05:08 -04:00
eric e9add46de0 update links back to main 2026-05-02 01:01:58 -04:00
eric e0728a6ab3 Update automakefortune.sh 2026-05-02 00:58:56 -04:00
eric bd7b0be8e6 Update vocafortune 2026-05-02 00:44:37 -04:00
eric 70e2b73883 Update installer.sh
again...
2026-05-02 00:35:37 -04:00
eric c5397a501b Update installer.sh 2026-05-02 00:29:30 -04:00
eric 542ba1b9b0 fix installer 2026-05-02 00:27:48 -04:00
eric a7cb1db0bc big update
made my own script to choose a song: vocafortune.

fixed issue where some songs would be duplicated, gave up on trying to check the date of the last song to know when to stop, changed it to the current date at midnight and added duplicate removal instead.

moved things around, should be easier to add other singers in the future if i choose to.

changed links to testing.
2026-05-02 00:24:21 -04:00
eric fe5c02be27 Update URLs to use main branch for downloads 2026-05-01 20:55:13 -04:00
eric 478877475b fix automakefortune.sh
failed last week because i forgot dumb stuff.
2026-04-27 23:01:03 -04:00
Eric Mitchell 0445d33adc Update fortune files 2026-04-28 02:58:45 +00:00
eric bb2c970a71 Update README with formatting corrections 2026-04-25 11:39:24 -04:00
eric b5f64677ee Merge pull request #1 from eric5949/test
add different tetos and clean up some things for future flexibiltiy
2026-04-25 11:38:28 -04:00
18 changed files with 443971 additions and 220022 deletions
+3 -6
View File
@@ -1,9 +1,10 @@
# **Kasane Teto in Your Terminal!** # **Kasane Teto in Your Terminal!**
## **Find songs nobody knows exist!** ## **Find songs nobody knows exist!**
A small wrapper and custom list for fortune/misfortune that picks a random Teto song of the day from any of almost 28,000 original, finished songs with videos on VocaDB. Your original fortune command will remain untouched, tetosong just tells it to use a custom directory. A small fortune type script that picks a random Teto song of the day from any of over 28,000 original, finished songs with videos on VocaDB.
## **Enable Audio to Hear "Teto Song of the Day!" in your terminal from Utau, SynthV, or SynthV2 Teto!** ## **Enable Audio to Hear "Teto Song of the Day!" in your terminal from Utau, SynthV, or SynthV2 Teto!**
Sound plays based on the song you get! Utau for Utau! SV for SV! Sound plays based on the song you get! Utau for Utau! SV for SV!
https://github.com/user-attachments/assets/bc2a9909-d24a-43fa-882a-5e785cda3020 https://github.com/user-attachments/assets/bc2a9909-d24a-43fa-882a-5e785cda3020
## **Now With Optional Automatic Updates!** ## **Now With Optional Automatic Updates!**
@@ -11,15 +12,11 @@ Disabled by default, opt-in during setup to enable a systemd user service and ti
## **Dependencies** ## **Dependencies**
NO LONGER REQUIRES FORTUNE
### install.sh and tetosong ### install.sh and tetosong
fortune/fortune-mod or misfortune
ffmpeg -optional for speaking Teto ffmpeg -optional for speaking Teto
### makefortune.sh ### makefortune.sh
fortune/fortune-mod (for strfile)
jq jq
## *Install and Run* ## *Install and Run*
Binary file not shown.
Binary file not shown.
+14 -62
View File
@@ -1,65 +1,17 @@
#!/usr/bin/bash #!/usr/bin/env bash
cd $HOME
# delete old tetosong repo and replace with updated one.
yes | rm -r tetosong
git clone git@github.com:eric5949/tetosong.git git clone git@github.com:eric5949/tetosong.git
cd tetosong cd tetosong
ARTIST=140308 # 116 is Kasane Teto # update vocafortunes.
CHILDREN="true" # If we want child voicebanks, we do so we can get all songs from utau, sv, and sv2 sh ./makefortune.sh -p Teto
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. sh ./makefortune.sh -p Gumi
RESULTS=100 # Max results. Limit is 100. sh ./makefortune.sh -p Miku
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.
if [ ! -f 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. # commit update
echo '{"lastDate": "2000-04-21T00:00:00Z"}' > var.json # if it doesn't exist, we create it with a default date back in 2000. git add ./*
fi git commit -m "Automated update of fortune files"
PREVDATE=$(jq -r '.lastDate' var.json)
AFTERDATE=$(date -u -d "$PREVDATE + 1 Second" +"%Y-%m-%dT%H:%M:%SZ")
echo "Result: $AFTERDATE"
#rm tetofortunes var.json tetofortunes.dat # during testing we will remove everything, or if we want to regenerate the fortune file from scratch.
# 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"
echo "CURLURL: $CURLURL"
DATA=$(curl -X 'GET' \
$CURLURL \
-H 'accept: application/json')
# making sure there are songs to add.
SONGS=$(echo "$DATA" | jq -c '.items | length')
if [ "$SONGS" -eq 0 ]; then
echo "Result is empty. No more songs."
exit 0
fi
DATE=$(echo "$DATA" | jq -r '.items[0].publishDate')
echo "DATE: $DATE"
echo "{\"lastDate\": \"$DATE\"}" > var.json
# looping the api to get all songs we need.
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"
DATA=$(curl -X 'GET' \
$CURLURL \
-H 'accept: application/json')
SONGS=$(echo "$DATA" | jq -r '.items | length')
if [ "$SONGS" -eq 0 ]; then
echo "Result is empty. No more songs."
break
else
START=$((START + SONGS))
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 "TETO SONG OF THE DAY!"
echo ""
echo "$artist -- $name"
echo ""
echo "$url"
echo ""
echo "▼・ᴗ・▼"
echo "%"
done >> tetofortunes
if [ "$START" -ge "$MAX" ]; then
echo "Reached max results. Stopping."
break
fi
echo "Done!"
fi
done
# create the fortune database from tetofortunes
rm tetofortunes.dat # delete the old database if it extists.
strfile -c % tetofortunes tetofortunes.dat
git commit -m "Update fortune files"
git push -u origin main git push -u origin main
+19 -7
View File
@@ -1,14 +1,24 @@
#!/usr/bin/bash #!/usr/bin/bash
#
# Updated 5-1-2026 to use new vocafortunes script instead of fortune/misfortune
#
#
# download custom fortunes and config file # download custom fortunes and config file
echo "Updating tetosong..." echo "Updating tetosong..."
# check if the config file exists, if not download it and prompt the user for options. # check if the config file exists, if not download it and prompt the user for options.
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
curl -sLo ~/.local/share/tetosong/tetosong.config https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/tetosong.config
fi
#### remove files from old version
rm -rf ~/.local/share/tetosong/fortunes/
# add new files
mkdir -p ~/.local/share/tetosong mkdir -p ~/.local/share/tetosong
mkdir -p ~/.local/share/tetosong/vocafortunes
mkdir -p ~/.local/share/tetosong/vocafortunes/vocadb
mkdir -p ~/.local/share/tetosong/fortunes curl -sLo ~/.local/share/tetosong/vocafortunes/vocadb/140308 https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/vocafortunes/vocadb/140308
mkdir -p ~/.local/share/tetosong/fortunes/tetosotd if [ -f ~/.local/share/tetosong/vocafortunes/vocadb/3 ]; then echo "Gumi found, updating Gumi songs..." # update Gumi
curl -sLo ~/.local/share/tetosong/fortunes/tetosotd/tetofortunes https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/fortunes/tetosotd/tetofortunes curl -sLo ~/.local/share/tetosong/tetosong.config https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/vocafortunes/vocadb/3
curl -sLo ~/.local/sharetetosong/fortunes/tetosotd/tetofortunes.dat https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/fortunes/tetosotd/tetofortunes.dat fi
AUDIO="$(. ~/.local/share/tetosong/tetosong.config; echo $AUDIO)" AUDIO="$(. ~/.local/share/tetosong/tetosong.config; echo $AUDIO)"
if [ "$AUDIO" = "YES" ]; then if [ "$AUDIO" = "YES" ]; then
curl -sLo ~/.local/share/tetosong/SOTD.zip https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/audio/teto/SOTD.zip curl -sLo ~/.local/share/tetosong/SOTD.zip https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/audio/teto/SOTD.zip
@@ -37,5 +47,7 @@ fi
echo "writing tetosong to ~/.local/bin" echo "writing tetosong to ~/.local/bin"
mkdir -p ~/.local/bin mkdir -p ~/.local/bin
curl -sLo ~/.local/bin/tetosong https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/tetosong curl -sLo ~/.local/bin/tetosong https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/tetosong
curl -sLo ~/.local/bin/tetosong https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/vocafortune
chmod +x ~/.local/bin/tetosong chmod +x ~/.local/bin/tetosong
echo "Update complete" chmod +x ~/.local/bin/vocafortune
echo "Make sure ~/.local/bin is in your PATH and you can get your Teto Song Of the Day by typing in tetosong or adding it to your bashrc :)"
+1
View File
@@ -0,0 +1 @@
{"lastDate": "2026-07-09T00:00:00Z"}
+1
View File
@@ -0,0 +1 @@
{"lastDate": "2026-07-09T00:00:00Z"}
+1
View File
@@ -0,0 +1 @@
{"lastDate": "2026-07-09T00:00:00Z"}
Binary file not shown.
+16 -21
View File
@@ -1,27 +1,20 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# check which fortune command is installed if any. #
if ! [ -x "$(command -v fortune)" ]; then # Updated 5-1-2026 to use new vocafortunes script instead of fortune/misfortune
echo 'fortune is not installed, checking for misfortune'm #
if ! [ -x "$(command -v misfortune)" ]; then #
echo 'neither program is installed, exiting' #
exit 1
else
echo 'misfortune found'
fi
else
echo 'fortune found'
fi
# download custom fortunes and config file # download custom fortunes and config file
echo "Downloading custom fortunes and config file..." echo "Downloading custom fortunes and config file..."
# download the config file and prompt the user for options. # download the config file and prompt the user for options.
mkdir -p ~/.local/share/tetosong mkdir -p ~/.local/share/tetosong
curl -sLo ~/.local/share/tetosong/tetosong.config https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/test/tetosong.config curl -sLo ~/.local/share/tetosong/tetosong.config https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/tetosong.config
read -p "Do you want to hear Teto in your terminal? (y/n) " yn read -p "Do you want to hear Teto in your terminal? (y/n) " yn
case $yn in case $yn in
[Yy]* ) [Yy]* )
sed -i 's|^AUDIO=.*|AUDIO="YES"|' ~/.local/share/tetosong/tetosong.config sed -i 's|^AUDIO=.*|AUDIO="YES"|' ~/.local/share/tetosong/tetosong.config
curl -sLo /tmp/SOTD.zip https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/test/audio/teto/SOTD.zip curl -sLo /tmp/SOTD.zip https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/audio/teto/SOTD.zip
mkdir -p ~/.local/share/tetosong/audio/ mkdir -p ~/.local/share/tetosong/audio/
mkdir -p ~/.local/share/tetosong/audio/teto/ mkdir -p ~/.local/share/tetosong/audio/teto/
unzip -o /tmp/SOTD.zip -d ~/.local/share/tetosong/audio/teto/ unzip -o /tmp/SOTD.zip -d ~/.local/share/tetosong/audio/teto/
@@ -38,10 +31,10 @@ case $yn in
* ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
esac esac
mkdir -p ~/.local/share/tetosong/fortunes mkdir -p ~/.local/share/tetosong/vocafortunes
mkdir -p ~/.local/share/tetosong/fortunes/tetosotd mkdir -p ~/.local/share/tetosong/vocafortunes/vocadb
curl -sLo ~/.local/share/tetosong/fortunes/tetosotd/tetofortunes https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/test/fortunes/tetosotd/tetofortunes curl -sLo ~/.local/share/tetosong/vocafortunes/vocadb/140308 https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/vocafortunes/vocadb/140308
curl -sLo ~/.local/share/tetosong/fortunes/tetosotd/tetofortunes.dat https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/test/fortunes/tetosotd/tetofortunes.dat
# set up autoupdater # set up autoupdater
# i use systemd, so i use systemd timers. I'll figure out something for non-systemd users later. # i use systemd, so i use systemd timers. I'll figure out something for non-systemd users later.
@@ -50,8 +43,8 @@ if [ "$AUTOUPDATE" = "YES" ]; then
# write and enable systemd service file and timer user services # write and enable systemd service file and timer user services
echo "Autoupdater enabled, updating service..." echo "Autoupdater enabled, updating service..."
mkdir -p ~/.config/systemd/user mkdir -p ~/.config/systemd/user
curl -sLo ~/.config/systemd/user/tetosong.service https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/test/autoupdater/tetosong.service curl -sLo ~/.config/systemd/user/tetosong.service https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/autoupdater/tetosong.service
curl -sLo ~/.config/systemd/user/tetosong.timer https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/test/autoupdater/tetosong.timer curl -sLo ~/.config/systemd/user/tetosong.timer https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/autoupdater/tetosong.timer
systemctl --user daemon-reload systemctl --user daemon-reload
systemctl --user enable tetosong.timer systemctl --user enable tetosong.timer
systemctl --user start tetosong.timer systemctl --user start tetosong.timer
@@ -61,6 +54,8 @@ fi
# write tetosong to ~/.local/bin and tell the user how to use it. # write tetosong to ~/.local/bin and tell the user how to use it.
echo "writing tetosong to ~/.local/bin" echo "writing tetosong to ~/.local/bin"
mkdir -p ~/.local/bin mkdir -p ~/.local/bin
curl -sLo ~/.local/bin/tetosong https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/test/tetosong curl -sLo ~/.local/bin/tetosong https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/tetosong
curl -sLo ~/.local/bin/vocafortune https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/vocafortune
chmod +x ~/.local/bin/tetosong chmod +x ~/.local/bin/tetosong
chmod +x ~/.local/bin/vocafortune
echo "Make sure ~/.local/bin is in your PATH and you can get your Teto Song Of the Day by typing in tetosong or adding it to your bashrc :)" echo "Make sure ~/.local/bin is in your PATH and you can get your Teto Song Of the Day by typing in tetosong or adding it to your bashrc :)"
+51 -38
View File
@@ -1,61 +1,74 @@
#!/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"
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 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"}' > 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
PREVDATE=$(jq -r '.lastDate' var.json) PREVDATE=$(jq -r '.lastDate' dates/${ARTIST}var.json)
AFTERDATE=$(date -u -d "$PREVDATE + 1 Second" +"%Y-%m-%dT%H:%M:%SZ") AFTERDATE=$(date -u -d "$PREVDATE -1 Day" +"%Y-%m-%dT%H:%M:%SZ") # i made it so it can process duplicate songs, and that does seem to actually work, so i moved the fetch time back a day just to make sure we dont miss songs when we update.
echo "Result: $AFTERDATE" echo "Result: $AFTERDATE"
#rm tetofortunes var.json tetofortunes.dat # during testing we will remove everything, or if we want to regenerate the fortune file from scratch.
# 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." DATE=$(date -u +%Y-%m-%dT00:00:00Z)
exit 0
fi
DATE=$(echo "$DATA" | jq -r '.items[0].publishDate')
echo "DATE: $DATE" echo "DATE: $DATE"
echo "{\"lastDate\": \"$DATE\"}" > 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 "" done >> vocafortunes/vocadb/$ARTIST
echo "$artist -- $name" if [ "$START" -ge "$MAX" ]; then echo "Reached max results. Stopping."; break; fi
echo ""
echo "$url"
echo ""
echo "▼・ᴗ・▼"
echo "%"
done >> tetofortunes
if [ "$START" -ge "$MAX" ]; then
echo "Reached max results. Stopping."
break
fi
echo "Done!" echo "Done!"
fi fi
done done
# create the fortune database from tetofortunes
rm tetofortunes.dat # delete the old database if it extists. # check for duplicates and save the file again.
strfile -c % tetofortunes tetofortunes.dat
readarray -d '`' tetosongs < vocafortunes/vocadb/$ARTIST
readarray -td '' dups < <((( ${#tetosongs[@]} == 0 )) || printf '%s\0' "${tetosongs[@]}" | 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[@]}
if ((${#dups[@]} > 0)); then echo >&2 "array has duplicates:"; echo ${#dups[@]};fi
if ((${#uniq[@]} > 0)); then echo >&2 "Uniques:"; echo ${#uniq[@]};fi
printf >&2 '%s' "${dups[@]}" > dups
printf >&2 '%s' "${uniq[@]}" > uniq
cat uniq > fixed
cat dups >> fixed
sed -i "1,/^${vsynth} SONG OF THE DAY!$/{/^${vsynth} SONG OF THE DAY!$/!d}" fixed
rm vocafortunes/vocadb/$ARTIST
rm uniq dups
mv fixed vocafortunes/vocadb/$ARTIST
+37
View File
@@ -0,0 +1,37 @@
tetosong has the following options:
-u : Update Tetosong
-h : display a help message
-p : set a singer prest. Currently supports:
- Teto (the default preset)
- Gumi
- Miku (limited songs rn)
########################################
makefortune.sh has the following options:
-s : Define singer based on vocadb artistid (1 for Miku, 3 For Gumi, 14308 for Teto, etc.)
-a : Define ascii/emoji art
-n : Define singer name in caps (TETO, GUMI, MIKU, etc)
-p : Preset option choice. Currently supports:
- Teto
- Gumi
- Miku
########################################
vocafortune has the following options:
-l : specify the directory vocafortune should look for fortunes
-f : specify a file for vocafortune to read
Vocafortune does not technically need to be used just for vocaloid songs.
It works similar to a fortune program in that it reads a text file with a delimiter and then returns an entry from that text file. Forune uses %, I use backtick (`) because many more vocaloid songs use % in the title than do backtick. Because there are *some* songs that do use the backtick, it's not a 100% perfect solution, but literally every character I could find to use as a delimeter is used in vocaloid song names
########################################
tetosong.config supports the following options at this time:
AUDIO : tells tetosong if it should play audio or not. Default on.
AUTOUPDATE : tells the installer/updater whether to install and enable systemd user service. Default off.
+56 -64
View File
@@ -1,71 +1,63 @@
#!/usr/bin/bash #!/usr/bin/env bash
# argument handling #
while [[ $# -gt 0 ]]; do # Updated 5-1-26 to use new vocafortune script and not require fortune/misfortune.
case $1 in # Updated 5-2-26 to add Miku and Gumi presets and shorten what i can just to see if i could.
-u|--update) #
echo "Downloading tetosong updater..." # argument handling ################# NEED TO UPDATE HELP
bash <(curl -s https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/autoupdater/updater.sh) while [[ $# -gt 0 ]]; do case $1 in
shift -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
exit 0 -h|--help) echo -e " --- TETOSONG HELP ---\n -h | display this message \n -u | update script and fortunes \n -p SINGER | set singer preset \n Running a preset will download and install songs for the selected singer and add a command to ~/.local/bin for that singer \n Current presets and commands following installation: \n Teto: tetosong \n Miku: mikusong (song list incomplete) \n Gumi: gumisong"; exit 0 ;; # tetosong help
;; *) break ;;
-h|--help) esac done
echo "--- TETOSONG HELP ---" while [ $# -gt 0 ]; do export "${1#-}"="$2"; shift 2; done # additional argument handling
echo "" if [ -z "$p" ]; then export preset="Teto"; else export preset="$p"; fi # option for presetting singer preset
echo " -h | display this message" 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
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
# check which fortune command is installed if any and then run it if [ "$preset" = "Teto" ]; then vocafortune -f "$HOME/.local/share/tetosong/vocafortunes/vocadb/140308" >> /tmp/fortune # Teto Preset, the default
if ! [ -x "$(command -v fortune)" ]; then
if ! [ -x "$(command -v misfortune)" ]; then
echo 'No fortune commmand is installed, exiting!'
exit 1
else
misfortune ~/.local/share/tetosong/fortunes/*/* >> /tmp/fortune # fortune and misfortune handle directories differently
if [ "$AUDIO" = "YES" ]; then # i guess i could foregoe checking and just run the audio either way since i dont download it unless the user enables it, but i want them to be ableto turn it off if they choose to
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 &
else
nohup ffplay -nodisp -autoexit -v quiet ~/.local/share/tetosong/audio/teto/sv2SOTD.wav 2>/dev/null >/dev/null &
fi
fi
cat /tmp/fortune
rm /tmp/fortune
fi
else
fortune ~/.local/share/tetosong/fortunes/* >> /tmp/fortune
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
mkdir -p $HOME/.local/share/tetosong/audio/miku
curl -sLo ~/.local/share/tetosong/vocafortunes/vocadb/1 https://raw.githubusercontent.com/eric5949/tetosong/refs/heads/main/vocafortunes/vocadb/1 # pull miku songs, not complete but theres around 600 or so.
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
mkdir -p $HOME/.local/share/tetosong/audio/gumi
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 && rm /tmp/fortune
cat /tmp/fortune
rm /tmp/fortune
fi
-1
View File
@@ -1 +0,0 @@
{"lastDate": "2026-04-24T00:00:00Z"}
Executable
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# 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!!!!!!
#fortune script
shopt -s globstar
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
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 "CHOICE"="$(shuf -i 1-$ITEMS -n 1)"
echo "${array[$CHOICE]}"
+11737
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+204631
View File
File diff suppressed because it is too large Load Diff