Commit Graph

139 Commits

Author SHA1 Message Date
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
Nathan LeRoy
f7fb8757e9
Fix return object formatting for multi-market searches (#527)
* resolve return object formatting issues referened in #526

* resolve comments from @ritiek

* create separate method to search multiple markets

* Use old description again

* market -> markets + fix test

* pep8

* Use break

Co-authored-by: Stephane Bruckert <contact@stephanebruckert.com>
2020-07-07 07:20:23 +01:00
Nathan LeRoy
2bfa7e0151
Add support to search multiple markets at once (#526)
* Add support to search multiple markets. Pass in a list or ALL to search all markets.

* pep8 formatting and verification with flake8

* work on comments from stephanebruckert

* pep8 formatting

* run autopep8 formatting

* fix typo

* allow tuple of markets to be passed. Add unit tests for this case
2020-07-03 19:31:52 +01:00
IdmFoundInHim
38515689bc
Support Implicit Grant Authorization Flow (Fix #499) (#515)
* Add SpotifyImplicitGrant with get_access_token and get_cached_token (and minimum related functions)

* Add some overlooked necessary methods/values in SpotifyImplicitGrant

* Remove unsuppported functionality and make SpotifyImplicitGrant public

* Allow/Expose integration of SpotifyImplicitGrant in client

* Add Implicit Grant tests and decrease abilities of prompt_for_user_token

Remove Implicit Grant and state support from prompt_for_user_token

* Add documentation and changelog entry

* Touch up PEP8 compliance

* Ignore long line with link for flake8

* Correct changelog

* Restore compatibility with Python 2.7

* Correct help(SpotifyImplicitGrant.get_access_token)

* Remove as_dict from SpotifyImplicitGrant.get_access_token

* Combine status check functionality with implicit grant support

In oauth2.py:
* Add state checking to SpotifyImplicitGrant
* Add dedicated SpotifyStateError as subclass of SpotifyOauthError
* Moved `_get_user_input` from SpotifyOAuth to superclass SpotifyAuthBase
* Renamed `parse_oauth_response_url` to `parse_auth_response_url`
* Moved error handling into `parse_auth_response_url`

Made minor changes in tests and client.py accordingly

* Update changelog

* Trim down tests for SpotifyImplicitGrant

* Fix trailing whitespace
2020-06-25 21:39:51 +01:00
kenmacf
d7ebc611b2
Enable market parameter for album_tracks (#516)
* enable market parameter for album_tracks

* update album_tracks docstring, add CHANGELOG entry
2020-06-19 22:30:54 +01:00
Dj
b09c1585c1
Remove basicConfig as it is not needed, fixes #478 (#482) 2020-04-26 23:52:57 +01:00
rako77
71a19de031
Added a method to update the auth token (#479)
* Added a method to update the auth token

* trying to fix errors
2020-04-26 21:39:12 +01:00
MatsErdkamp
98d49fb20e
Fixed documentation audio features, fixes #468 (#469)
Line 1235: 
OLD - tracks - a list of track URIs, URLs or IDs, maximum: *50* ids
NEW - tracks - a list of track URIs, URLs or IDs, maximum: *100* ids
2020-04-12 12:02:23 +01:00
Stephane Bruckert
c6de8dc713 Fix no handler could be found for logger 2020-04-11 13:32:23 +01:00
Dj
b01adba826
Print -> Logging, fixes #84 (#461) 2020-04-03 23:03:09 +01:00
Loisaida Sam
ccfda079c8
Propagate refresh token error, fixes #259 (#261)
* Propagate refresh token error #259

https://github.com/plamere/spotipy/issues/259

* Lint

* Format

Co-authored-by: Stephane Bruckert <contact@stephanebruckert.com>
2020-04-02 20:03:24 +01:00
AlPoza
5b5b30dd0f
Add session in SpotifyAuthBase (#383)
Co-authored-by: XIS01536 <apozadel@extern.isban.es>
Co-authored-by: Stephane Bruckert <contact@stephanebruckert.com>
2020-04-01 23:02:56 +01:00
Stephane Bruckert
6d7fe6c195 Close session when spotipy is unloaded, fixes #90 2020-04-01 21:57:56 +01:00
Dj
024a6c96d4
Retries For All Endpoints, fixes #347 (#457)
* test_improvements - Add __init__.py files to tests dirs so you can run all tests

* test_improvements - added helpers file, restructured tests to work without previous data and to be grouped with api type

* http_retries - Implement Retry for all requests

* Readme - Update README with contributing info

* PR Feedback - Added CONTRIBUTING.md, fixed README, fixed test
2020-03-29 17:18:23 +01:00
jugdizh
8b84300597
Added endpoints for shows/podcasts and episodes, closes #450
https://developer.spotify.com/documentation/web-api/reference-beta/#category-shows
https://developer.spotify.com/documentation/web-api/reference-beta/#category-episodes
2020-03-24 21:36:25 +00:00
Peter-Schorn
9315d00990
'add to queue' endpoint added (#452) 2020-03-13 00:58:04 +00:00
Stephane Bruckert
f43fd568d6 Link to proxies doc, solves #449 2020-03-11 23:40:39 +00:00
Stephane Bruckert
13109c1613 Update tracks doc, fixes #160 2020-02-22 13:11:32 +00:00
Stephane Bruckert
9bd2169b49 Update recommendations doc, fixes #290 2020-02-22 13:08:26 +00:00
Stephane Bruckert
125267fa4e Fix exception is raised in exception handler, fixes #403 2020-02-16 12:37:52 +00:00
Stephane Bruckert
2273696850 Add position_ms to start_playback 2020-02-12 23:35:38 +00:00
Stefano
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
S Murthy
3b0e8febc4
Linting of core subpackage + clean up imports (#437)
* Linting of OAuth2 mod. + update tests to detect core package path

* Tweak imports in tests + update tox ini to ignore Flake8 E501 error

* Tweak tox ini - ignore examples

* Remove `f`-string from OAuth2 mod.

* More import tweaks in core package + tests

* Update flake8 config. in tox ini - set line length limit to 99 chars.
2020-02-09 12:59:20 +00:00
MLK97
9056bd1309 updated documentation for search method 2020-02-05 15:48:31 +01:00
Stephane Bruckert
93412a7b78 Add query doc link, closes #268 2020-02-02 16:04:44 +00:00
Wil Collins
ff7c33e97d Support after/before in current_user_recently_played 2020-01-26 13:50:45 +00:00
CyanBook
349587ca32 Support for playlist_cover_image (#431) 2020-01-26 13:20:20 +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
Stéphane Bruckert
1807905572
Support to upload playlist covers (#416) 2020-01-20 19:56:24 +00:00
Stephane Bruckert
3d22cf29ce Deprecate old endpoints 2020-01-16 23:14:52 +00:00
CyanBook
49011c337f
Update client.py 2020-01-15 22:07:49 +01:00
CyanBook
8678cd1f20
Added playlist_tracks 2020-01-15 22:00:56 +01:00
Stéphane Bruckert
542389900f
Merge branch 'master' into client-internal-call-refactor 2020-01-13 19:58:53 +00:00
Ritiek Malhotra
3e2e8ed0fb Trim '?<key>' when extracting ID from HTTP URLs
If this excess part isn't trimmed from the ID, it can cause unexpected
results when calling some API methods.

For example; this code now correctly returns all albums for an artist:
```
artist = 'https://open.spotify.com/artist/7oPftvlwr6VrsViSDV7fJY?si=M3PrzRC4TBOZu8YyLYc-tA'
artist_albums = sp.artist_albums(artist)
```

Previously, this code mimicked same behaviour as calling
`spotify.artist`, but now will return albums as expected
with this commit.

Fixes #365 and #323.
2020-01-13 20:24:53 +05:30
Stéphane Bruckert
f54830e272
Add linter, solves #348 (#415) 2020-01-12 13:19:40 +00:00
Stéphane Bruckert
b1ceab2b8f
Merge pull request #392 from TimJay/master
requests_cache compatibility
2020-01-12 01:48:16 +00:00
Stéphane Bruckert
549e692af6
Merge pull request #235 from amsimoes/patch-1
Fixes typo on recommendations usage comment
2020-01-12 00:42:08 +00:00
Stephane Bruckert
6ab96c3c91 Clean up + missing tests 2020-01-11 23:30:57 +00:00
Ryan Lee
2aa67580a1 Add current_user_saved_albums_delete method 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
Harrison
f1b796cf35 remove duplicate audio_analysis 2020-01-11 19:54:21 +00:00
Ryan K. Lee
3f321bf5d4 update limit on current_user_saved_albums 2020-01-11 19:54:21 +00:00
Mostafa Garana
7b85b5ca63 Adding an endpoint for unfollowing users/artists. 2020-01-11 19:54:21 +00:00
Matt Comben
f8a6e4edb6 Fix bug where formatted arguments are passed to self._warn, which only accepts a single string 2020-01-11 19:54:21 +00:00
Brecht Yperman
e44bd7a936 Add library album management functions 2020-01-11 19:54:21 +00:00
Halvor Strand
469fbf1b1e Fixed docstring error
Fixed user_playlist_remove_all_occurrences_of_tracks docstring error, having "add to" instead of "remove from".
2020-01-11 19:54:21 +00:00
HES SONG
9d88a68d50 Update client.py (add playlist endpoint)
There was an upate with Spotify Web APi to bring playlist with using ID.
2020-01-11 19:54:21 +00:00
Sandeep Murthy
e9edf2a255 Miscellaneous fixes - clean up tests 2020-01-11 19:54:20 +00:00
Sandeep Murthy
e1ba4a9bbb Re-order imports and specify UTF-8 encoding header in all base modules and package initialiser (ref. https://www.python.org/dev/peps/pep-0008/#imports, https://www.python.org/dev/peps/pep-0008/#source-file-encoding) + add __all__ attribute 2020-01-11 19:54:20 +00:00