Created
January 13, 2018 11:21
-
-
Save badboy/d870a6fb6fe69bed970ad7b06520dba5 to your computer and use it in GitHub Desktop.
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 | |
uri=$(xclip -o -selection clipboard) | |
notify-send "soundcloud" "Started downloading from URL." | |
pushd ~/music | |
bakpl=~/.mpd/playlists/current2.m3u | |
realpl=~/.mpd/playlists/current.m3u | |
logfile=/tmp/ytdl-sc.log | |
date > $logfile | |
echo "$uri" >> $logfile | |
youtube-dl "$uri" --exec "mpc update && sleep 2 && mpc add {} && mpc save current2 && mv $bakpl $realpl" &>> $logfile | |
notify-send "soundcloud" "Added track." | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment