How to use the spotipy.trace function in spotipy

To help you get started, we’ve selected a few spotipy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github guirem / plugin-googlecast / resources / pychromecast / examples / spotify_example.py View on Github external
self.got_members=True

# Wait for connection to the chromecast
cast.wait()

spotify_device_id = None

# Create a spotify token
data = st.start_session(args.user, args.password)
access_token = data[0]
expires = data[1] - int(time.time())

# Create a spotify client
client = spotipy.Spotify(auth=access_token)
if args.show_debug:
    spotipy.trace = True
    spotipy.trace_out = True

# Launch the spotify app on the cast we want to cast to
sp = SpotifyController(access_token, expires)
cast.register_handler(sp)
sp.launch_app()

if not sp.is_launched and not sp.credential_error:
    print('Failed to launch spotify controller due to timeout')
    sys.exit(1)
if not sp.is_launched and sp.credential_error:
    print('Failed to launch spotify controller due to credential error')
    sys.exit(1)

# Query spotify for active devices
devices_available = client.devices()
github balloob / pychromecast / examples / spotify_example.py View on Github external
self.got_members=True

# Wait for connection to the chromecast
cast.wait()

spotify_device_id = None

# Create a spotify token
data = st.start_session(args.user, args.password)
access_token = data[0]
expires = data[1] - int(time.time())

# Create a spotify client
client = spotipy.Spotify(auth=access_token)
if args.show_debug:
    spotipy.trace = True
    spotipy.trace_out = True

# Launch the spotify app on the cast we want to cast to
sp = SpotifyController(access_token, expires)
cast.register_handler(sp)
sp.launch_app()

if not sp.is_launched and not sp.credential_error:
    print('Failed to launch spotify controller due to timeout')
    sys.exit(1)
if not sp.is_launched and sp.credential_error:
    print('Failed to launch spotify controller due to credential error')
    sys.exit(1)

# Query spotify for active devices
devices_available = client.devices()