Conversation
|
Related: radiorabe/suisa_sendemeldung#268 |
| return self.json(path="/api/external-metadata/tracks", params=params).get( | ||
| "data" | ||
| ) |
There was a problem hiding this comment.
it should probably also pass kwargs along so users can pass additional args to requests.get (like a session for retry/backoff).
| return self.json(path="/api/external-metadata/tracks", params=params).get( | |
| "data" | |
| ) | |
| return self.json( | |
| path="/api/external-metadata/tracks", | |
| params=params, | |
| **kwargs, | |
| ).get("data") |
| "data" | ||
| ) | ||
| except HTTPError as error: | ||
| print(error) |
There was a problem hiding this comment.
imo libs should not have side effects like print()
| print(error) |
There was a problem hiding this comment.
Yes, I just pushed the code to have it somewhere. I agree :)
| return self.json(path="/api/external-metadata/tracks", params=params).get( | ||
| "data" | ||
| ) | ||
| except HTTPError as error: |
There was a problem hiding this comment.
Is this error persistent? if it's a temporary error a retry/backoff loop might be better than ignoring it.
There was a problem hiding this comment.
🤔 retry/backoff code is already here:
python-acrclient/acrclient/client.py
Lines 46 to 56 in 399bcc9
maybe we need to tune it, or it doesn't include 500 errors
There was a problem hiding this comment.
For some entries, the error persists and for some it returns 200 after retrying a few seconds later. You're absolutely correct to handle this in the central location.
Reference: https://docs.acrcloud.com/reference/metadata-api
This adds support for the Metadata API.