Commit Graph

502 Commits

Author SHA1 Message Date
foobuzz
cc5e234a28
Allow for total headless mode by instructing the user to open the URL in a browser. (#528)
* Allow for total headless mode by instructing the user to open the URL in a browser.

* Fix line too long

* Update changelog

* Clarify changelog entry

* Remove reduntant log about pasting the URL.
2020-07-08 17:45:17 +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
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
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
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
24df9ea4cf Bump to 2.13.0 2020-06-25 22:04:44 +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
foobuzz
ed136d15df
Check the state (#509)
* - Verify that the state received alongside the authorization code is consistent with the one sent
- Refactor URL parsing for the local server way and the interactive way
- Add tests for interactive way

* Resurrect public methods parse_response_code and get_authorization_code

* Use new method parse_oatuh_response_url for parse_response_code implementation.
2020-06-20 21:48:19 +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
Stephane Bruckert
ccc73b9d22 Update Issues section 2020-06-15 21:28:13 +01:00
Stephane Bruckert
25e6ed61bb Update issue templates 2020-06-15 21:22:08 +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
Stéphane Bruckert
816457b7d5
Merge pull request #500 from ysinjab/refactor-unittests-to-accept-generic-user
Refactor two unittests that could fail for some users and make them more generic
2020-05-29 09:37:59 +01:00
Stéphane Bruckert
d287dd23ae
Merge pull request #501 from ysinjab/add-error-details-to-spotify-auth-error-class
Refactor SpotifyOauthError class
2020-05-29 09:37:35 +01:00
Yasser Sinjab
99f636d6e7 Add changelog 2020-05-28 02:23:16 +03:00
Yasser Sinjab
7da89b3137 Fix class initialization
- make super python 2 compatible for SpotifyOauthError
2020-05-27 23:38:44 +03:00
Yasser Sinjab
901b2031a2 Refactor SpotifyOauthError class
- add error and error description to SpotifyOauthError to reflect the data returned by web api when error happens
- unit test to SpotifyClientCredentials.get_access_token is added for invalid client
2020-05-27 23:26:47 +03:00
Yasser Sinjab
7906417c1d Refactor two unittests that could fail for
some users and make them more generic.
2020-05-27 03:28:37 +03:00
Marlon (Esolitos) Saglia
5c981a1d62
In '__init__' super method should use static class name (#497)
Currently it is not possible to extend SpotifyClientCredentials and SpotifyOAuth
This is because in the class __init__ they refer to 'self.__class__', this leads
to an infinite recursion if the parent class doesn't override completely the __init__
method.
2020-05-25 14:32:18 +01:00
Stéphane Bruckert
2e2c7259a9
Add FAQ (#485)
* Add FAQ

* Add FAQ to README
2020-05-01 16:54:26 +01:00
Stephane Bruckert
2584d8cf56 Bump to 2.12.0 2020-04-26 23:56:16 +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
Stephane Bruckert
c58501972c Bump to 2.11.2 2020-04-19 22:46:32 +01:00
Jonas Camillus Jeppesen
d3bab0f054
Fix issue with hanging authorization process if no port is provided, fixes #471, fixes #474 (#477)
* Fixed issue where using rediret uri 'localhost' (without specifying a port) would cause the authorization process to hang (not asking the user to paste/enter the URL redirected to)

* Updated the documentation to match the changes to the authorization process - also kind of fixing issues #474 and #471

* Fixed Flake8 over-indentation remark
2020-04-19 22:39:03 +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
73654a0646 Bump to 2.11.1 2020-04-11 17:43:13 +01:00
Stephane Bruckert
02cd9b0923 Improve URL parsing, fixes #171, fixes #253, fixes #276, solves #467 2020-04-11 17:40:26 +01:00
Stephane Bruckert
d4912c6679 Update contributing 2020-04-11 13:43:54 +01:00
Stephane Bruckert
a61422ef4b Bump to 2.11.0 2020-04-11 13:32:43 +01:00
Stephane Bruckert
c6de8dc713 Fix no handler could be found for logger 2020-04-11 13:32:23 +01:00
Jonne Kaunisto
85dfc680fe
Added syntax highlighting to README (#463) 2020-04-03 23:41:43 +01:00
Jonne Kaunisto
b6d35d4926
Moved dependencies to setup.py extras (#462) 2020-04-03 23:04:05 +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
Stephane Bruckert
73aac90bbe Auto-close auth browser window 2020-04-01 21:25:48 +01:00
Zsolt Cserna
acdcfcecf8
oauth2.py: add local http server to serve redirects (#243)
When spotify redirects the browser to localhost, serve the page with a
simple http server implemented by HTTPServer. By this way, we can obtain
the tokens the oauth service want so provide us, and no need to input the
user the redirect URL.

This method only works when the application in spotify developer dashboard
is configured to redirect the requests to localhost.

To use this method it is required to specify the redirect_url pointing to
localhost with simple http, to a non-privilegized port (unless the script is
run as root).
2020-04-01 18:16:13 +01:00
Dj
7a06046e2b
http-retries - documented changes for issue (#347) (#460) 2020-03-29 22:57:43 +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
Stephane Bruckert
4b8350b8bc Bump to 2.10.0 2020-03-18 20:39:26 +00:00
Stephane Bruckert
3baa19abd1 Release with CHANGELOG + LICENSE, solves #454 2020-03-18 20:34:22 +00:00
Peter-Schorn
3fb2454740
Update CHANGELOG (#453) 2020-03-13 00:58:32 +00:00
Peter-Schorn
9315d00990
'add to queue' endpoint added (#452) 2020-03-13 00:58:04 +00:00
Stephane Bruckert
37b6b5fd80 Add multiple accounts example, solves #446 2020-03-12 00:53:36 +00:00
Stephane Bruckert
f43fd568d6 Link to proxies doc, solves #449 2020-03-11 23:40:39 +00:00
Ritiek Malhotra
3a156a1f92
Merge pull request #447 from plamere/remove-unnecessary-print-statements
Remove unnecessary print statements
2020-03-03 06:39:08 +05:30