#!/bin/python from subprocess import Popen,PIPE import string USER = "username" PASS = "password" print "XM Radio Player Script (^C Exits)" print "XM Radio Favorites" print "202 - The Virus XL" print "48 - Squizz" print "83 - Chrome" print "150 - XM Comedy XL" REPLY = raw_input("XM Radio Channel? ") SPEED = raw_input("Speed/Quality? (low or high): ") if REPLY == "": print "I need a Channel to listen to." else: cmd = 'mplayer ' cmd = cmd + '-vo null ' cmd = cmd + '-cache 256 ' cmd = cmd + '-playlist "http://www.xstreamxm.com/mobile/stream.asx?' cmd = cmd + 'email=' + USER + '&' cmd = cmd + 'pass=' + PASS + '&' cmd = cmd + 'chan=' + REPLY + '&' cmd = cmd + 'speed=' + SPEED + '"' print "Opening channel " + REPLY p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE) out = string.join(p.stdout.readlines()) outerr = string.join(p.stderr.readlines()) print out print outerr