#!/bin/rc
if(! ~ $#* 1 || ! ~ `{echo $1 | wc -c} 12 || ~ $1 *[~0-9a-zA-Z-_]*){
	echo usage: $0 videoId >[1=2]
	exit usage
}
hget `{
	hpost -u http://yt1s.com -p /api/ajaxConvert/convert vid:$1 k:`{
		hpost -u http://yt1s.com -p /api/ajaxSearch/index 'q:https://youtube.com/watch?v='^$1 |
			jb -p | awk '/^links\/mp3\/mp3128\/k: /{print $2}'
	} | jb -p | awk '/^dlink: /{print $2}'
} > $1.mp3