コード例 #1
0
ファイル: test_spotify_oauth.py プロジェクト: simeg/musicify
def _spotify_oauth(requester=None,
                   client_id="arbitrary-client_id",
                   client_secret="arbitrary-client_secret",
                   redirect_uri="arbitrary-redirect_uri",
                   state="arbitrary-state",
                   scope="arbitrary-scope") -> SpotifyOAuth:
    return SpotifyOAuth(requester, client_id, client_secret, redirect_uri,
                        state, scope)
コード例 #2
0
def _spotify_oauth() -> SpotifyOAuth:
    c = cfg.spotify_api()
    redirect_uri = '%s/callback' % \
                   ('https://musicify.herokuapp.com' if IS_PRODUCTION
                    else 'http://0.0.0.0:8000')
    state = 'TODO'
    scope = 'user-read-private'
    return SpotifyOAuth(
        requests,  # Pass in the external library
        client_id=c['client_id'],
        client_secret=c['client_secret'],
        redirect_uri=redirect_uri,
        state=state,
        scope=scope)