utils.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:plugin.audio.spotify 作者: marcelveldt 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号