💾 Archived View for runjimmyrunrunyoufuckerrun.com › rc › sc captured on 2022-03-01 at 15:21:16.

View Raw

More Information

⬅️ Previous capture (2021-12-17)

🚧 View Differences

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

#!/bin/rc
# sc: download a track from soundcloud
if(! ~ $#* 1){
	echo 'usage: sc url' >[1=2]
	exit usage
}
label $1
# to find a key, ctrl-shift-i on a megabrowser,
# refresh network tab & search for client_id
key = XN2B69zrNGzHSSxMkvbp6MJYR1cHKOoH
a = nope
hget 'https://api-v2.soundcloud.com/resolve?url='^$1^'&client_id='^$key | json | tee /fd/2 |
	while(~ $a nope && b = `{read})
		if(~ $#b 2 && ~ $b(1) url: && ~ $b(2) *progressive)
			a = yep
if(~ $a nope){echo url not found; exit}
a = `{basename $1}
echo -n '
label' $a '; echo hide >/dev/wctl; hget '
hget $b(2)^'?client_id='^$key | sed 's†.*"(http.*)".*†''\1''†' | tr -d \xa
echo ' | tput -p >' /tmp/mp3/$a.mp3 '|[2] aux/statusmsg -t && exit'