💾 Archived View for runjimmyrunrunyoufuckerrun.com › rc › sc captured on 2022-01-08 at 13:39:23.

View Raw

More Information

⬅️ Previous capture (2021-12-17)

➡️ Next capture (2022-03-01)

-=-=-=-=-=-=-

#!/bin/rc
# sc: download a song from soundcloud

api = https://api.soundcloud.com
clientid = 5b1cde38cb883dacf205ae7865ac387d

switch($#*){
case 2
	dest=$2
case 1
	dest=`{echo $1 |sed 's;.*/;;'}
	dest=/tmp/mp3/$dest.mp3
case *
	echo 'usage: sc url [ dest ]' >[1=2]
	exit usage
}

url=`{hget $api^'/resolve.json?url='^$1^'&client_id='^$clientid |
	sed 's/.*"stream_url":"([^"]+)".*/\1/'}

hget $url^'?client_id='^$clientid |
	tput -p > $dest |[2] aux/statusmsg $dest &