API duration filter request

60 views
Skip to first unread message

inou

unread,
May 17, 2021, 4:44:44 AM5/17/21
to Freesound API
Hi,

As I mentioned in this thread (https://freesound.org/forum/bug-reports-errors-and-feature-requests/43034/), when requesting using the filtering by the duration the response received is an ERROR 400. 

This is part of the code used: 

results_pager = freesound_client.text_search(
    query="relax",
    fields="id,name,username,license,type,duration",
    filter="duration:[0.0 TO 901.0]",
    sort="duration_desc"
)


On the other hand, the used URL callback is the following: 

Regards,
Ignasi.

Frederic Font Corbera

unread,
May 17, 2021, 10:52:28 AM5/17/21
to freeso...@googlegroups.com
Hi Ignasi,

Looking at the code I assume you're using the Python client. Make sure you're using the latest version (releases ~25 days ago) of it which does not include "www" in the base URL. I suspect you might be using  a docker image from a UPF workshop which includes the python client. In that case you should pull the newest version of the image (which I just pushed) to make sure you get the up to date dependencies. You probably need to tell docker-compose to force rebuild the images.

Cheers,

frederic


--
Frederic Font - ffont.github.io
Music Technology Group, UPF - mtg.upf.edu
Freesound - freesound.org



--

---
You received this message because you are subscribed to the Google Groups "Freesound API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to freesound-ap...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/freesound-api/8aa961be-a1b6-4729-b805-38d0d2d06776n%40googlegroups.com.

inou

unread,
May 17, 2021, 2:18:56 PM5/17/21
to freeso...@googlegroups.com
Hi Frederic,

Thanks for the quick reply. 
Yes, I am using the Python client, the one from the MTG GitHub (https://github.com/MTG/freesound-python).
I just deleted the old one, cloned the new version, and reinstalled it, I had a previous version (with the www), but I keep getting the same error message.

Regards,
Ignasi. 

Missatge de Frederic Font Corbera <freder...@upf.edu> del dia dl., 17 de maig 2021 a les 16:52:
You received this message because you are subscribed to a topic in the Google Groups "Freesound API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/freesound-api/DIrOKiuJ0Ro/unsubscribe.
To unsubscribe from this group and all its topics, send an email to freesound-ap...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/freesound-api/CABDPa_yXwCW7kotE_kcdzekYy4wvT4md7dLEd0_i19gyY0QK%2BA%40mail.gmail.com.

Saba Nazir

unread,
May 17, 2021, 2:43:11 PM5/17/21
to Freesound API
Hi Frederic,

Initially the newer version with no www in Host name worked for me for filtering audios but after retrieving every 15 files whenever it goes to the next page I get the same error. 
Do you think I need to update something else?

Thanks
Saba. 

Frederic Font Corbera

unread,
May 18, 2021, 1:31:39 AM5/18/21
to freeso...@googlegroups.com
Hi,

There is indeed an issue with the pagination which has just been fixed.
@Ignasi: if your error has happening when doing pagination, it should be fixed now. However also double-check that the queries you're making to Freesound don't have the www. in them. You might want to hack the python client to add a print statement when the url is constructed.

Cheers,

frederic

--
Frederic Font - ffont.github.io
Music Technology Group, UPF - mtg.upf.edu
Freesound - freesound.org


Saba Nazir

unread,
May 18, 2021, 6:57:22 AM5/18/21
to Freesound API
Hi,

Thanks Frederic. It's resolved for me. 
@Ignasi: I simply installed the newer Python client and now it is working for me. 

Best,
Saba. 

inou

unread,
May 20, 2021, 4:47:46 AM5/20/21
to freeso...@googlegroups.com
Hi,

I have just checked it and I had the same related error to the pagination. Now it is working fine. 

Thank you,
Regards,
Ignasi.

Missatge de Saba Nazir <wwor...@gmail.com> del dia dt., 18 de maig 2021 a les 12:57:
Reply all
Reply to author
Forward
0 new messages