developmentseed / bioacoustics-api

Google Bioacustics API that runs the backend for A2O Search
https://devseed.com/api-docs/?url=https://api.search.acousticobservatory.org/api/v1/openapi
MIT License
1 stars 0 forks source link

Support for downloading audio from a2o #34

Closed geohacker closed 1 year ago

geohacker commented 1 year ago

@willemarcel could we add support to proxy the https://api.acousticobservatory.org/audio_recordings/ endpoint? This is required to download the search results for subsequent search https://github.com/developmentseed/bioacoustics-frontend/issues/123

This is a sample request that @oliverroick is look at: requesting https://api.acousticobservatory.org/audio_recordings/510500/media.flac?start_offset=355&end_offset=360.

willemarcel commented 1 year ago

I think the best solution here is to instruct the user to save it by clicking with the right button on the link and choosing "Save link as" option. Example: https://jsfiddle.net/pqofnk5z/

There is a download attribute in the <a> element, but it only works in same domain requests. So, It wouldn't change anything if we proxy it, as the domain of the frontend is different from the API.

geohacker commented 1 year ago

@willemarcel I'm not sure that's ideal — we should be able to request the download via our API by resetting the origin. Don't we do this already on other requests?