Skip to content

Commit

Permalink
Fixed Termux setup script. (#1159)
Browse files Browse the repository at this point in the history
Add Script to setup spotdl on termux - @s1as3r
  • Loading branch information
s1as3r authored Feb 5, 2021
1 parent e90f79f commit d135787
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ You need to download FFmpeg to use this tool. Download and installation instruct
#### On Termux:

```
curl https://github.com/spotDL/spotify-downloader/raw/master/termux/setup_spotdl.sh | sh
curl -L https://github.com/spotDL/spotify-downloader/raw/master/termux/setup_spotdl.sh | sh
```

___YouTube Music must be available in your country for spotDL to work. This is because we use YouTube Music to filter search results. You can check if YouTube Music is available in your country, by visiting [YouTube Music](https://music.youtube.com).___
Expand Down
16 changes: 13 additions & 3 deletions termux/setup_spotdl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@
termux-setup-storage

# update packages
pkg update
pkg update -y

# install python and ffmpeg
pkg install python ffmpeg
pkg install -y python ffmpeg

# install spotdl
pip install -U spotdl
pip install -U spotdl

if [ ! -d "$HOME/bin" ]; then
mkdir "$HOME/bin"
fi

if [ ! -f "$HOME/bin/termux-url-opener" ]; then
touch $HOME/bin/termux-url-opener
fi

curl -L https://raw.githubusercontent.com/spotDL/spotify-downloader/master/termux/termux-url-opener > $HOME/bin/termux-url-opener
15 changes: 15 additions & 0 deletions termux/termux-url-opener
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/data/data/com.termux/files/usr/bin/bash

SONGS="$HOME/storage/shared/songs"
SPOTDL="/data/data/com.termux/files/usr/bin/spotdl"

if [[ $1 == *"open.spotify.com"* ]]; then
if [[ ! -d $SONGS ]]; then
mkdir $SONGS
fi

cd $SONGS
$SPOTDL "$1"

read -n 1 -s -p "Press Any Key To Exit."
fi

0 comments on commit d135787

Please sign in to comment.