diff --git a/spotipy/client.py b/spotipy/client.py index 62ca3f1..a022232 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -252,7 +252,7 @@ class Spotify(object): msg = error.get("message") reason = error.get("reason") except ValueError: - # if the response cannnot be decoded into JSON (which raises a ValueError), + # if the response cannot be decoded into JSON (which raises a ValueError), # then try to decode it into text # if we receive an empty string (which is falsy), then replace it with `None` @@ -1739,7 +1739,7 @@ class Spotify(object): ): """ Start or resume user's playback. - Provide a `context_uri` to start playback or a album, + Provide a `context_uri` to start playback or an album, artist, or playlist. Provide a `uris` list to start playback of one or more @@ -1882,7 +1882,7 @@ class Spotify(object): If device A is currently playing music and you try to add to the queue and pass in the id for device B, you will get a 'Player command failed: Restriction violated' error - I therefore reccomend leaving device_id as None so that the active device is targeted + I therefore recommend leaving device_id as None so that the active device is targeted :param uri: song uri, id, or url :param device_id: diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index 0f30f5f..631a865 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -40,7 +40,7 @@ class SpotifyOauthError(Exception): class SpotifyStateError(SpotifyOauthError): - """ The state sent and state recieved were different """ + """ The state sent and state received were different """ def __init__(self, local_state=None, remote_state=None, message=None, error=None, error_description=None, *args, **kwargs): @@ -136,8 +136,8 @@ class SpotifyAuthBase(object): error = error_payload.get('error') error_description = error_payload.get('error_description') except ValueError: - # if the response cannnot be decoded into JSON (which raises a ValueError), - # then try do decode it into text + # if the response cannot be decoded into JSON (which raises a ValueError), + # then try to decode it into text # if we receive an empty string (which is falsy), then replace it with `None` error = response.text or None @@ -213,7 +213,7 @@ class SpotifyClientCredentials(SpotifyAuthBase): def get_access_token(self, as_dict=True, check_cache=True): """ If a valid access token is in memory, returns it - Else feches a new token and returns it + Else fetches a new token and returns it Parameters: - as_dict - a boolean indicating if returning the access token @@ -630,7 +630,7 @@ class SpotifyPKCE(SpotifyAuthBase): This auth manager enables *user and non-user* endpoints with only a client secret, redirect uri, and username. When the app requests - an an access token for the first time, the user is prompted to + an access token for the first time, the user is prompted to authorize the new client app. After authorizing the app, the client app is then given both access and refresh tokens. This is the preferred way of authorizing a mobile/desktop client. @@ -669,7 +669,7 @@ class SpotifyPKCE(SpotifyAuthBase): * requests_timeout: Optional, tell Requests to stop waiting for a response after a given number of seconds * requests_session: A Requests session - * open_browser: Optional, thether or not the web browser should be opened to + * open_browser: Optional, whether or not the web browser should be opened to authorize a user * cache_handler: An instance of the `CacheHandler` class to handle getting and saving cached authorization tokens. @@ -1025,7 +1025,7 @@ class SpotifyImplicitGrant(SpotifyAuthBase): * parse_response_token(url) -> get_access_token(parse_response_code(url)); get_cached_token() - The security concern in the Implict Grant flow is that the token is + The security concern in the Implicit Grant flow is that the token is returned in the URL and can be intercepted through the browser. A request with an authorization code and proof of origin could not be easily intercepted without a compromised network. @@ -1043,7 +1043,7 @@ class SpotifyImplicitGrant(SpotifyAuthBase): cache_handler=None): """ Creates Auth Manager using the Implicit Grant flow - **See help(SpotifyImplictGrant) for full Security Warning** + **See help(SpotifyImplicitGrant) for full Security Warning** Parameters ---------- @@ -1066,7 +1066,7 @@ class SpotifyImplicitGrant(SpotifyAuthBase): "Grant Flow for client-side code. Use the SpotifyPKCE " "auth manager instead of SpotifyImplicitGrant. For " "more details and a guide to switching, see " - "help(SpotifyImplictGrant).") + "help(SpotifyImplicitGrant).") self.client_id = client_id self.redirect_uri = redirect_uri diff --git a/spotipy/util.py b/spotipy/util.py index 2c28d1c..b949a61 100644 --- a/spotipy/util.py +++ b/spotipy/util.py @@ -90,7 +90,7 @@ def prompt_for_user_token( ) # try to get a valid token for this user, from the cache, - # if not in the cache, the create a new (this will send + # if not in the cache, then create a new (this will send # the user to a web page where they can authorize this app) token_info = sp_oauth.validate_token(sp_oauth.cache_handler.get_cached_token()) diff --git a/tests/integration/test_non_user_endpoints.py b/tests/integration/test_non_user_endpoints.py index 7ac5120..5628a82 100644 --- a/tests/integration/test_non_user_endpoints.py +++ b/tests/integration/test_non_user_endpoints.py @@ -236,7 +236,7 @@ class AuthTestSpotipy(unittest.TestCase): sp = spotipy.Spotify(requests_timeout=0.01, client_credentials_manager=client_credentials_manager) - # depending on the timing or bandwidth, this raises a timeout or connection error" + # depending on the timing or bandwidth, this raises a timeout or connection error self.assertRaises((requests.exceptions.Timeout, requests.exceptions.ConnectionError), lambda: sp.search(q='my*', type='track'))