Commit Graph
117 Commits
Author SHA1 Message Date
004df7b2df A few updates to the example app (#540)
* No username needed + can be used by multiple users

* cleanup

* Remove caches when signing out

* Persist token only once

* Always show auth page

* Add one scope..

* Add a second scope and also a view which utilizes a scope.

* Add a __main__ clause example.

* Include further documentation.

* Move utility function higher in document.

* Add threading to application run call in __main__.

* Add (or reinstate–I thought it had been there) the "me" view.

* Add notes about SPOTIPY_REDIRECT_URI and using alternate port.

And specify that it should be the address that the App runs over.

* Whitespace only.

* Here is an example of importing credentials.

* Delete session_cache file on logout so new user can Authorize.

* Not going to use at this point.

* Update the "me" route method to use new approach to auth.

* Update app.py

Co-authored-by: Stephane Bruckert <contact@stephanebruckert.com>
Co-authored-by: Stephane Bruckert <stephane.bruckert@gmail.com>
2020-07-30 23:05:47 +01:00
Stéphane Bruckert f136442c2d Fix Flask example app (#539) 2020-07-26 20:46:35 +01:00
IdmFoundInHim 88cf75b778 Update Playlist Endpoints and Add Following Endpoints (#531)
* Update playlist endpoints to modern format

Deprecate user_playlist_* in favor of the following replacements:
* user_playlist_change_details -> playlist_change_details
* user_playlist_unfollow -> current_user_unfollow_playlist
* user_playlist_add_tracks -> playlist_add_tracks
* user_playlist_replace_tracks -> playlist_replace_tracks
* user_playlist_reorder_tracks -> playlist_reorder_tracks
* user_playlist_remove_all_occurrences_of_tracks -> playlist_remove_all_occurrences_of_tracks
* user_playlist_remove_specific_occurrences_of_tracks -> playlist_remove_specific_occurrences_of_tracks
* user_playlist_follow_playlist -> current_user_follow_playlist
* user_playlist_is_following -> playlist_is_following

* Add current_user_following_artists and current_user_following_users

* Update tests and examples

Resolve TODO in test_user_endpoints.py > SpotifyFollowApiTests.test_user_follows_and_unfollows_user

Use modern playlist endpoints (no username required) in tests and examples.

* Update changelog

* Deprecate playlist_tracks in favor of playlist_items

* Link deprecated functions to new functions and change tracks to items

* Fix references to playlist_tracks

* Change test_playlist_add_items as requested
2020-07-11 11:23:18 +01:00
Mike iLL Kilmer 7eb0eaaebc Add redirect_uri (#529)
And specify that it should be the address that the App runs over.
2020-07-06 18:58:39 +01:00
Omglolyes a8b77ac37d Get all non-local tracks from a spotify playlist (#518)
* Create playlist_all_tracks.py

* Update playlist_all_tracks.py

forgot first items from playlist

* print result instead of returning it

* rename to playlist_all_non_local_tracks

* Update playlist_all_non_local_tracks.py

removed "== True" as it's implied
give an example playlist (global top 50)
more comments
corrected typo

* print only length and excluding instead of entire result
2020-06-30 18:15:25 +01:00
Stephane Bruckert c7f2edf343 Deprecate util.prompt_for_user_token() 2020-06-14 18:01:14 +01:00
Stephane Bruckert 587baec9b9 Example to use spotipy in an API, closes #287 2020-05-30 16:39:53 +01:00
Dj b01adba826 Print -> Logging, fixes #84 (#461) 2020-04-03 23:03:09 +01:00
Stephane Bruckert 37b6b5fd80 Add multiple accounts example, solves #446 2020-03-12 00:53:36 +00:00
Stephane Bruckert 28485cfa3e Lint 2020-02-22 11:15:19 +00:00
Stephane Bruckert 9ed584b398 Player endpoints example and test 2020-02-22 11:12:29 +00:00
Stephane Bruckert 60f530842d Fix 2020-02-12 23:14:26 +00:00
Stephane Bruckert 14268a8a2c Add playlist_tracks example 2020-02-12 23:08:42 +00:00
StefanoandStéphane Bruckert 4515446a65 Auto-refresh AuthCode flow token. (#435)
* Auto-refresh AuthCode flow token.

* Reformatted.

* Reformatted.

* Removed invalid syntax.

* Removed abstract class SpotifyAuthManager.

* Fix typo on docstrings.

* Optionally try to fetch main input parameters from environment.

Implements the capability of trying to fetch the following parameters from the environment, when they're not directly passed to the authorization handler.
The affected parameters are: client_id, client_secret, redirect_uri.
An SpotifyOauthError is raised if no value gets found.

* Removed f-string for Python2 compatibility.

* Fix line-too-long.

* Remove useless import.

* Add username to docstring.

* Remove redundant return.

* Fix empty lines print statement for backward compatibility with Python2.

* Update simple4 example.

* Set optional 'as_dict' parameter on OAuth 'get_access_token'.

* Update changelog.

Co-authored-by: Stéphane Bruckert <stephane.bruckert@gmail.com>
2020-02-10 10:20:02 +00:00
Stephane Bruckert 26db832e24 Temporarily revert #428 2020-01-23 10:06:19 +00:00
Peter 87a72a060f Automatic refresh of Authorization Code Flow Tokens in long-running Applications (#428)
* auto-refresh user token

* example for a long-running user-request app

* wrap long lines

* combine duplicate code into _refresh_token_if_expired method

* add changelog entry
2020-01-22 20:01:30 +00:00
Stephane Bruckert 44911f7285 Fix show_my_saved_tracks example, closes #70 2020-01-17 19:12:26 +00:00
Stephane Bruckert 45c3e5e951 Update/remove outdated examples 2020-01-16 23:47:18 +00:00
Stephane Bruckert 83a1cb54ef Fix doc and readme 2020-01-16 03:54:39 +00:00
Stéphane Bruckert 9b8c90dbe1 Merge branch 'master' into master 2020-01-15 19:16:38 +00:00
Stéphane Bruckert f54830e272 Add linter, solves #348 (#415) 2020-01-12 13:19:40 +00:00
Stéphane Bruckert 9b3b61bdc4 Merge pull request #224 from foxyblue/clean-examples
Clean examples
2020-01-12 00:48:11 +00:00
Stephane Bruckert c4b302b4e2 Fix example 2020-01-12 00:22:57 +00:00
Stéphane Bruckert 2be6763d0d Merge pull request #303 from wdr1/patch-1
Update create_playlist.py
2020-01-12 00:10:03 +00:00
Stephane Bruckert 6ab96c3c91 Clean up + missing tests 2020-01-11 23:30:57 +00:00
Ryan Lee c610090a7c Upload user_saved_albums_delete.py 2020-01-11 19:56:32 +00:00
Harrison d8d9f290fb remove unneccesary whitespaces, shorten some lines, and add name to contibutors 2020-01-11 19:56:00 +00:00
Ryan K. Lee 5f45a0a54e Update show_album.py
Import SpotifyClientCredentials from spotipy.oauth2
2020-01-11 19:54:21 +00:00
Ryan K. Lee bd1a122831 Update show_artist.py
Import SpotifyClientCredentials from spotipy.oauth2
2020-01-11 19:54:21 +00:00
Ryan K. Lee e3185e22ec Update show_artist_top_tracks.py
Import SpotifyClientCredentials from spotipy.oauth2
2020-01-11 19:54:21 +00:00
Ryan K. Lee 90f1105648 Update show_related.py
Import SpotifyClientCredentials from spotipy.oauth2
2020-01-11 19:54:21 +00:00
Ryan K. Lee 5a00758609 Update show_track_info.py
Import SpotifyClientCredentials from spotipy.oauth2
2020-01-11 19:54:21 +00:00
Ryan K. Lee c3bae42b9e Update simple0.py
Import oath
2020-01-11 19:54:21 +00:00
Ryan K. Lee 0c453c9945 Update simple1.py
Import oath
2020-01-11 19:54:21 +00:00
Ryan K. Lee a677267bca Update simple2.py
Add import statements for oath
2020-01-11 19:54:21 +00:00
Ryan K. Lee faa5785a29 Update simple3.py
add import statements for oath
2020-01-11 19:54:21 +00:00
Ryan K. Lee ba667d388c Update remove_tracks_from_playlist.py
Update comments
2020-01-11 19:54:21 +00:00
Ryan K. Lee 32a6d4867b Update remove_specific_tracks_from_playlist.py
Update comments
2020-01-11 19:54:21 +00:00
Ryan K. Lee 3ed903e6ce Update print parentheses in read_a_playlist.py 2020-01-11 19:54:21 +00:00
Ryan K. Lee cc158c34f1 Fix comments and parentheses in my_top_tracks.py 2020-01-11 19:54:21 +00:00
Ryan K. Lee ba6e9a0b79 Add parentheses after print in my_top_artists.py 2020-01-11 19:54:21 +00:00
Ryan K. Lee 91639996e1 Fix comments in my_playlists.py 2020-01-11 19:54:21 +00:00
William Reardon 1ea4d475b5 Update create_playlist.py
Added scope to token request
2018-06-23 20:37:58 -07:00
Alisha Ukani 63eebfa930 Use client credentials flow to fix broken non-authorized requests 2018-01-16 18:58:21 -05:00
Sebastien (Work) 6c83f09898 Format examples
Add spaces after ':' and ','.
    Remove spaces before and after '(', '{', '[', ']', '}'
    and ')'.
2017-10-23 23:02:17 +01:00
Sebastien (Work) 0b0942423c Remove spaces around keyword operator
remove space around operator '=' for keywords.
2017-10-23 22:53:20 +01:00
Sebastien (Work) 0eeeeb4a50 Remove unused imports
All imported modules that were note used in examples
    have been removed.
2017-10-23 22:50:05 +01:00
Paul Lamere 91d89c3256 Merge branch 'master' into playlist_description_support 2017-09-17 12:03:49 -04:00
Paul Lamere 0e40d2bfc2 Merge pull request #212 from wesleybratt/patch-1
update user_playlists_contents.py
2017-09-17 11:59:21 -04:00
wesleybratt 6c572ff5cd update user_playlists_contents.py
removed unused os import and unused variable 'top'
2017-09-10 20:05:42 -07:00