Created
June 26, 2020 17:06
-
-
Save akinozgen/c6415a28f6196327b98d6be2828861c5 to your computer and use it in GitHub Desktop.
Download any song by searching in dmenu.
This file contains 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
#!/bin/bash | |
directory="$(find -L ~ -type d -not -path '*/\.*' -not -path '*/Android/*' -maxdepth 5 | dmenu -i -l 10 -p 'Where do you want to save the file? Only absolute path...')" | |
query="$(echo '' | dmenu -i -p 'Search for Artist - Song name format')" | |
provider="$(echo -e 'Youtube\nSpotify' | dmenu -i -l 2 -p 'Select provider')" | |
cd $directory | |
if [ "$provider" = "Spotify" ] | |
then | |
spotdl --song "$query" -f "$directory/{artist} - {track-name}.{output-ext}" | |
elif [ "$provider" = "Youtube" ] | |
then | |
youtube-dl "ytsearch1:$query" -x --audio-format mp3 -o "$directory/%(title)s.%(ext)s" | |
fi | |
exit | |
clear |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment