def run_spotty(self, arguments=None):
'''On supported platforms we include spotty binary'''
try:
args = [
self.__spotty_binary,
"-u", self.username,
"-p", self.password,
"--disable-discovery" # for now, disable dns discovery
]
if arguments:
args += arguments
if not "-n" in args:
args += ["-n", self.playername]
# if self.__cache_path:
# args += ["-c", self.__cache_path, "--enable-audio-cache"]
startupinfo = None
if os.name == 'nt':
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW
return subprocess.Popen(args, startupinfo=startupinfo, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, bufsize=0)
except Exception as exc:
log_exception(__name__, exc)
return None
评论列表
文章目录