If you use
curl https://domain/index.php/s/SHARE_ID/download
you will download compressed directory, but you can always download file by file To find files you can use
curl -X PROPFIND
to the /public.php/webdav/
. It was mentioned here Uploading a file to File Drop using http post method, but I do not know how it works, I only can see that request is done via Browser, when I trying to do this via curl - not succeed.