Closed Notmarrco closed 7 years ago
Hi,
I'm trying to submit a fingerprint, but I got an Exception.
When I submit directly via the web API in my browser, the submit is successful.
Here is my code :
>>> (d, f) = acoustid.fingerprint_file('song.mp3') >>> data = {'duration': d, 'fingerprint': f, 'mbid': 'f77afe3f-d335-409c-bc5f-a5271fee23c8'} >>> client = 'xxxxxx' >>> user = 'xxxxxx' >>> acoustid.submit(client, user, data) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/notmarrco/.local/lib/python3.5/site-packages/acoustid.py", line 379, in submit raise WebServiceError("error {0}: {1}".format(code, message)) acoustid.WebServiceError: error 2: missing required parameter "duration.0"
I provide "duration" so I don't understand the "missing required parameter" exception.
Thanks
found it : I had to take the math.floor(d) for duration.
math.floor(d)
Glad you worked it out! Perhaps we should add a check that the duration is passed in as an int… a PR to that effect would be very welcome.
int
Hi,
I'm trying to submit a fingerprint, but I got an Exception.
When I submit directly via the web API in my browser, the submit is successful.
Here is my code :
I provide "duration" so I don't understand the "missing required parameter" exception.
Thanks