Skip to content

Commit

Permalink
Remove client id from requests following SC uath changes.
Browse files Browse the repository at this point in the history
This workaround (fix?) was reported in mopidy#123
  • Loading branch information
kingosticks authored and wallon-ines committed May 6, 2023
1 parent dc9ab02 commit 4e98959
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mopidy_soundcloud/soundcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ def send(self, request, **kwargs):


class SoundCloudClient:
CLIENT_ID = "93e33e327fd8a9b77becd179652272e2"

public_client_id = None

def __init__(self, config):
Expand Down Expand Up @@ -285,7 +283,7 @@ def resolve_url(self, uri):

def _get(self, url, limit=None):
url = f"https://api.soundcloud.com/{url}"
params = [("client_id", self.CLIENT_ID)]
params = []
if limit:
params.insert(0, ("limit", self.explore_songs))
try:
Expand Down Expand Up @@ -429,7 +427,7 @@ def get_streamable_url(self, sharing, permalink_url, stream_url):
)

# ~quickly yields rate limit errors
req = self.http_client.head(f"{stream_url}?client_id={self.CLIENT_ID}")
req = self.http_client.head(stream_url)
if req.status_code == 302:
return req.headers.get("Location", None)
elif req.status_code == 429:
Expand Down

0 comments on commit 4e98959

Please sign in to comment.