Skip to content

Instantly share code, notes, and snippets.

@SwapnilSoni1999
Created July 31, 2019 09:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SwapnilSoni1999/e163a8c380e1cdfa65cecbf71972a579 to your computer and use it in GitHub Desktop.
Save SwapnilSoni1999/e163a8c380e1cdfa65cecbf71972a579 to your computer and use it in GitHub Desktop.
termux-url-opener for SpotifyDL - https://www.npmjs.com/package/spotify-dl
#!/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
@ripadsemo
Copy link

nice

@Constantine640
Copy link

Can't download it by sharing form app
Screenshot_20200820-220309
Screenshot_20200820-174618

@SwapnilSoni1999
Copy link
Author

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