Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Commit

Permalink
adjust check_response
Browse files Browse the repository at this point in the history
  • Loading branch information
glomatico committed May 10, 2024
1 parent 3b44f07 commit 1100b43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spotify_web_downloader/spotify_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ class SpotifyApi:
)
METADATA_API_URL = "https://api.spotify.com/v1/{type}/{track_id}"
PATHFINDER_API_URL = "https://api-partner.spotify.com/pathfinder/v1/query"
TRACK_CREDITS_API_URL = (
"https://spclient.wg.spotify.com/track-credits-view/v0/experimental/{track_id}/credits"
)
TRACK_CREDITS_API_URL = "https://spclient.wg.spotify.com/track-credits-view/v0/experimental/{track_id}/credits"
EXTEND_TRACK_COLLECTION_WAIT_TIME = 0.5

def __init__(
Expand Down Expand Up @@ -70,7 +68,9 @@ def _setup_session(self):

@staticmethod
def _check_response(response: requests.Response):
if not response.ok:
try:
response.raise_for_status()
except requests.HTTPError:
raise Exception(
f"Request failed with status code {response.status_code}: {response.text}"
)
Expand Down

0 comments on commit 1100b43

Please sign in to comment.