Compare commits

..

No commits in common. "7ec9a84749730fba150a36d9ef19e7d066509438" and "e28ec850132833f96fa7c45042a8eadf3bd95a30" have entirely different histories.

View file

@ -1,13 +1,8 @@
#!/bin/bash
downloadTrack() {
if [ "$#" -ge 1 ]; then
echo "Downloading track with ID: $1"
id="$1"
else
echo "Enter track ID:"
read -r id
fi
json_data=$(curl -s "https://tidal.401658.xyz/track/?id=$id&quality=LOSSLESS")
track_name=$(echo "$json_data" | jq -r '.[0].title')
artist_name=$(echo "$json_data" | jq -r '.[0].artist.name')
@ -19,12 +14,8 @@ downloadTrack() {
}
searchTrack() {
if [ "$#" -ge 1 ]; then
track_name="$1"
else
echo "Enter track name:"
read -r track_name
fi
track_name=$(echo "$track_name" | sed 's/ /%20/g')
tracks=$(curl -s "https://tidal.401658.xyz/search/?s=$track_name" | jq -r '.items[] | "\(.id) - \(.title) by \(.artist.name)"')
@ -48,22 +39,6 @@ searchTrack() {
echo "Welcome to Tidal music downloader"
echo ""
if [ "$1" = "search" ]; then
if [ "$#" -ge 2 ]; then
shift
jsw="$*"
searchTrack "$jsw"
else
searchTrack
fi
elif [ "$1" = "download" ]; then
if [ "$#" -ge 2 ]; then
downloadTrack "$2"
else
downloadTrack
fi
else
echo "Choose: 1 = download ; 2 = search"
read option
if [ "$option" -eq 1 ]; then
@ -71,5 +46,5 @@ else
elif [ "$option" -eq 2 ]; then
searchTrack
fi
fi