mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
Removed the `client_credentials_manager` and `oauth_manager` parameters because they are redundant. Replaced the `set_auth` and `auth_manager` properties with standard attributes. Removed the following deprecated methods from `Spotify`: * `playlist_tracks` * `user_playlist` * `user_playlist_tracks` * `user_playlist_change_details` * `user_playlist_unfollow` * `user_playlist_add_tracks` * `user_playlist_replace_tracks` * `user_playlist_reorder_tracks` * `user_playlist_remove_all_occurrences_of_tracks` * `user_playlist_remove_specific_occurrences_of_tracks` * `user_playlist_follow_playlist` * `user_playlist_is_following` Removed the deprecated `as_dict` parameter from the `get_access_token` method of `SpotifyOAuth` and `SpotifyPKCE`. Removed the deprecated `get_cached_token` and `_save_token_info` methods of `SpotifyOAuth` and `SpotifyPKCE`. Removed `SpotifyImplicitGrant`. Removed `prompt_for_user_token`.
22 lines
444 B
Python
22 lines
444 B
Python
import spotipy
|
|
from spotipy.oauth2 import SpotifyOAuth
|
|
from pprint import pprint
|
|
from time import sleep
|
|
|
|
scope = "user-read-playback-state,user-modify-playback-state"
|
|
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope))
|
|
|
|
# Shows playing devices
|
|
res = sp.devices()
|
|
pprint(res)
|
|
|
|
# Change track
|
|
sp.start_playback(uris=['spotify:track:6gdLoMygLsgktydTQ71b15'])
|
|
|
|
# Change volume
|
|
sp.volume(100)
|
|
sleep(2)
|
|
sp.volume(50)
|
|
sleep(2)
|
|
sp.volume(100)
|