Created
July 31, 2019 09:26
-
-
Save SwapnilSoni1999/e163a8c380e1cdfa65cecbf71972a579 to your computer and use it in GitHub Desktop.
termux-url-opener for SpotifyDL - https://www.npmjs.com/package/spotify-dl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/data/data/com.termux/files/usr/bin/bash | |
# Get the URL | |
URL=$1 | |
clear | |
# Check if its spotify URL or not. | |
# if it is then execute spotifydl command to download. | |
if [[ $URL == *"open.spotify.com"* ]]; then | |
SONG_DIR="$HOME/storage/shared/songs" #for Termux only | |
NODE_ENV=$(which node) | |
SPOTIFYDL=$(which spotifydl) | |
echo "Spotifydl (NPM) Created by Swapnil Soni ©" | |
# check if directory exist or not | |
if [[ ! -d $SONG_DIR ]]; then | |
# directory doesn't exist create it for use. | |
mkdir $SONG_DIR | |
fi | |
# Download the song to song directory. | |
$NODE_ENV $SPOTIFYDL $URL -o $SONG_DIR | |
read -n 1 -s -p "Press any key to exit..." | |
fi |
yes @Constantine640
because spotify is now attaching extra text while sharing so its an issue now better run command from now on
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice