use "std" use "http" use "json" channel = "lynxcatgirl" def USHER_API(channel, token, sig) = sprintf("http://usher.twitch.tv/api/channel/hls/%s.m3u8?player=twitchweb&token=%s&sig=%s&allow_audio_only=true&allow_source=true&type=any&p=%d", channel, token, sig, rand(1000000)) TOKEN_API = "http://api.twitch.tv/api/channels/" + channel + "/access_token" thread(::http, TOKEN_API, def(r) { data = jsondecode(r) url = USHER_API(channel, data.token, data.sig) //use "robot" //toClipboard(m3uurl) use "android" startActivity(Intent.ACTION_VIEW, url) })