Exemplo n.º 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)
Exemplo n.º 2
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,
    )
Exemplo n.º 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'])