Compare commits

..

No commits in common. "4d2876f82b8166ea80c46da5128deed39fb8930d" and "aa0d9eed00a8063f80e6a0106308ad9905d2f6bd" have entirely different histories.

4 changed files with 13 additions and 85 deletions

View file

@ -1,18 +0,0 @@
# Maintainer: Medvidek77 <medvidek77@tuta.io>
pkgname=tidler
pkgver=0.1
pkgrel=1
pkgdesc="Tidal music downloader based on the hifi-tui API"
arch=('any')
url="https://medvidek77.tech/Medvidek77/tidler"
license=('BSD3-Clause')
depends=('bash' 'curl' 'jq')
source=("git+$url.git#branch=stable")
sha256sums=('SKIP')
package() {
cd "$srcdir/$pkgname"
install -Dm755 src/tidler "$pkgdir/usr/bin/tidler"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

View file

@ -1,13 +0,0 @@
#!/bin/sh
if [ "$EUID" -ne 0 ]; then
echo "Please run script as root"
exit 1
else
if [ ! -f /bin/tidler ]; then
install -m 755 ../../src/tidler /bin/tidler
else
echo "TiDLer is already installed"
fi
fi

View file

@ -1,12 +0,0 @@
#!/bin/sh
if [ "$EUID" -ne 0 ]; then
echo "Please run script as root"
exit 1
else
if [ -f /bin/tidler ]; then
cd ../../
git pull
install -m 755 src/tidler /bin/tidler
fi
fi

55
src/tidler Executable file → Normal file
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
echo "Downloading track with ID: $1"
id="$1"
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
echo "Enter track name:"
read -r track_name
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)"')
@ -33,11 +24,6 @@ searchTrack() {
tracks_list+=("$list")
done <<< "$tracks"
if [ "${#tracks_list[@]}" -eq 1 ]; then
echo "No tracks found :("
exit 1
fi
PS3="Please select a track: "
select t in "${tracks_list[@]}"; do
if [ -n "$t" ]; then
@ -51,29 +37,14 @@ searchTrack() {
done
}
echo "Welcome to TiDLer -> 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 for download track or 2 for search track and download"
read option
if [ "$option" -eq 1 ]; then
downloadTrack
elif [ "$option" -eq 2 ]; then
searchTrack
fi
echo "Welcome to Tidal music downloader"
echo ""
echo "Choose: 1 = download ; 2 = search"
read option
if [ "$option" -eq 1 ]; then
downloadTrack
elif [ "$option" -eq 2 ]; then
searchTrack
fi