コード例 #1
0
def oauth_client(config):
    return web.OAuthClient(
        base_url='https://api.spotify.com/v1',
        refresh_url='https://auth.mopidy.com/spotify/token',
        client_id=config['spotify']['client_id'],
        client_secret=config['spotify']['client_secret'],
        proxy_config=None,
        expiry_margin=60)
コード例 #2
0
ファイル: test_web.py プロジェクト: kvndrsslr/mopidy-spotify
def oauth_client(config):
    return web.OAuthClient(
        base_url="https://api.spotify.com/v1",
        refresh_url="https://auth.mopidy.com/spotify/token",
        client_id=config["spotify"]["client_id"],
        client_secret=config["spotify"]["client_secret"],
        proxy_config=None,
        expiry_margin=60,
    )
コード例 #3
0
    def on_start(self):
        self._actor_proxy = self.actor_ref.proxy()
        self._session = self._get_session(self._config)

        self._event_loop = spotify.EventLoop(self._session)
        self._event_loop.start()

        self._session.login(self._config['spotify']['username'],
                            self._config['spotify']['password'])

        self._web_client = web.OAuthClient(
            refresh_url='https://auth.mopidy.com/spotify/token',
            client_id=self._config['spotify']['client_id'],
            client_secret=self._config['spotify']['client_secret'],
            proxy_config=self._config['proxy'])