FollieHiyuki-dotfiles/home/.local/bin/lyrics

15 lines
407 B
Bash
Executable File

#!/bin/sh
echo "Artist: " | tr -d '\n'
read -r artist
echo "Song: " | tr -d '\n'
read -r song
# Nice look
echo "========================"
artist=$(echo "$artist" | sed s/" "/%20/g | sed s/"&"/%26/g | sed s/,/%2C/g | sed s/-/%2D/g)
song=$(echo "$song" | sed s/" "/%20/g | sed s/"&"/%26/g | sed s/,/%2C/g | sed s/-/%2D/g)
curl -s "https://api.lyrics.ovh/v1/$artist/$song" | jq -r ".lyrics" | sed '/\r$/d'